Commit 59ddc86 1 parent 4876ff6 commit 59ddc86 Copy full SHA for 59ddc86
File tree 2 files changed +14
-5
lines changed
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 44
44
run : exit 1
45
45
- name : Let command fail
46
46
id : failed_command
47
- run : swift package swiftlint
47
+ run : swift package plugin --allow-writing-to-package-directory swiftlint
48
48
continue-on-error : true
49
49
- name : Verify that command failed
50
50
if : ${{ steps.failed_command.outcome != 'failure' }}
61
61
echo "force_cast: warning" > .swiftlint.yml
62
62
- name : Check that all commands pass
63
63
run : |
64
- swift package swiftlint | grep -q "Force Cast Violation"
64
+ swift package plugin --allow-writing-to-package-directory swiftlint | grep -q "Force Cast Violation"
65
65
xcodebuild -scheme SwiftLintPluginsTest -destination 'platform=macOS' -skipPackagePluginValidation build | grep -q "Force Cast Violation"
Original file line number Diff line number Diff line change @@ -15,12 +15,21 @@ let package = Package(
15
15
. plugin(
16
16
name: " SwiftLintBuildToolPlugin " ,
17
17
capability: . buildTool( ) ,
18
- dependencies: [ . target( name: " SwiftLintBinary " ) ]
18
+ dependencies: [ . target( name: " SwiftLintBinary " ) ] ,
19
+ packageAccess: false
19
20
) ,
20
21
. plugin(
21
22
name: " SwiftLintCommandPlugin " ,
22
- capability: . command( intent: . custom( verb: " swiftlint " , description: " SwiftLint Command Plugin " ) ) ,
23
- dependencies: [ . target( name: " SwiftLintBinary " ) ]
23
+ capability: . command(
24
+ intent: . custom( verb: " swiftlint " , description: " SwiftLint Command Plugin " ) ,
25
+ permissions: [
26
+ . writeToPackageDirectory(
27
+ reason: " When this command is run with the `--fix` option it may modify source files. "
28
+ ) ,
29
+ ]
30
+ ) ,
31
+ dependencies: [ . target( name: " SwiftLintBinary " ) ] ,
32
+ packageAccess: false
24
33
) ,
25
34
. binaryTarget(
26
35
name: " SwiftLintBinary " ,
You can’t perform that action at this time.
0 commit comments