-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using --strict --fix hides errors and succeeds #5387
Comments
funny thing is that using |
Linting and fixing are two different modes. With For which rules specifically does no promotion happen when running |
Example: Modify 2 files:
Run: swiftlint lint --fix --strict Behavior:
If you run the same command again, however, B isn't reported, and I believe this may be what @ladislas was pointing out. |
A check could be added that warns about
I cannot see that. |
I'll keep this open awaiting your feedback. |
@JaviSoto yes exactly! thanks for clarifying :)
@SimplyDanny that makes it clear! any reason why they don't work together? |
This is nice so at least the user knows this is going on, but it's still undesireable behavior: if you're using |
I get the confusion now. With Without a new option, this would be a breaking change, though. |
New Issue Checklist
Describe the bug
We are using swiftlint with pre-commit with the command provided in the documentation
It does fix the issues but it does not fail.
changing to just
swiftlint
fails as expected but doesn't fix the issuesComplete output when running SwiftLint, including the stack trace and command used
with
swiftlint --fix --strict
$ gc -a trim trailing whitespace.................................................Passed fix end of files.........................................................Passed check yaml...............................................................Passed check json...........................................(no files to check)Skipped check for added large files..............................................Passed check that executables have shebangs.................(no files to check)Skipped check that scripts with shebangs are executable..........................Passed detect private key.......................................................Passed forbid submodules....................................(no files to check)Skipped mixed line ending........................................................Passed SwiftLint................................................................Passed SwiftFormat..............................................................Passed
just with
swiftlint
Environment
swiftlint version
to be sure)?Homebrew
no
xcodebuild -version
)?echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
to quickly test if your example is really demonstrating the issue. If your example is more
complex, you can use
swiftlint lint --path [file here] --no-cache --enable-all-rules
.It involves using pre-commit, so no
The text was updated successfully, but these errors were encountered: