Skip to content

Commit 86b01a3

Browse files
authored
SwiftLint recommends a double run when fixing
https://github.com/realm/SwiftLint#xcode recommends > If you wish to fix violations as well, your script could run `swiftlint --fix && swiftlint` instead of just `swiftlint`. This will mean that all correctable violations are fixed while ensuring warnings show up in your project for remaining violations. https://github.com/realm/SwiftLint#auto-correct > Standard linting is disabled while correcting because of the high likelihood of violations (or their offsets) being incorrect after modifying a file while applying corrections.
1 parent 985210c commit 86b01a3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/macOS-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ jobs:
4242
- name: SwiftLint
4343
run: |
4444
# Adding --fix flag makes CI print only errors that cannot be fixed automatically
45-
swiftlint --fix
45+
# 1. Make automated fixes that are possible
46+
# 2. git diff to see what automated fixes were made
47+
# 3. See https://github.com/realm/SwiftLint#xcode explains why the double run
48+
swiftlint --fix && git diff && swiftlint
4649
- name: Resolve dependencies
4750
run: swift package resolve
4851
- name: Build

0 commit comments

Comments
 (0)