Skip to content

Commit 59ddc86

Browse files
authored
Sync plugin properties with main repository (#4)
1 parent 4876ff6 commit 59ddc86

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
run: exit 1
4545
- name: Let command fail
4646
id: failed_command
47-
run: swift package swiftlint
47+
run: swift package plugin --allow-writing-to-package-directory swiftlint
4848
continue-on-error: true
4949
- name: Verify that command failed
5050
if: ${{ steps.failed_command.outcome != 'failure' }}
@@ -61,5 +61,5 @@ jobs:
6161
echo "force_cast: warning" > .swiftlint.yml
6262
- name: Check that all commands pass
6363
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"
6565
xcodebuild -scheme SwiftLintPluginsTest -destination 'platform=macOS' -skipPackagePluginValidation build | grep -q "Force Cast Violation"

Package.swift

+12-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@ let package = Package(
1515
.plugin(
1616
name: "SwiftLintBuildToolPlugin",
1717
capability: .buildTool(),
18-
dependencies: [.target(name: "SwiftLintBinary")]
18+
dependencies: [.target(name: "SwiftLintBinary")],
19+
packageAccess: false
1920
),
2021
.plugin(
2122
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
2433
),
2534
.binaryTarget(
2635
name: "SwiftLintBinary",

0 commit comments

Comments
 (0)