-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Keep track of already linted/autocorrected files. #868
Comments
This sounds a bit out of scope. If you just don't lint files that have been modified from the last linting, then you will loose any warnings/errors generated by those. Simply running swiftlint twice in a row would therefore always not emit any errors or warnings. You could solve this by tracking only files that have linted successfully, but my point is that I think this gets complicated quickly--particularly if you want to clear the linting status of every project on There are a few other solutions you can consider:
|
If you run |
Will the |
No. But For reference, you can run |
When you run |
What you're requesting is akin to a compiler cache, and probably very useful for large projects. I'd certainly welcome a PR to SwiftLint that added this type of caching. In the meantime, some users are using modified files in git to only lint changed files: #785 (comment). That may be an option for you too. |
I was thinking about this since we now have more rules and linting takes more time. On my MBP 15", https://github.com/kickstarter/ios-oss takes almost 5s and I believe that would prevent me for running SwiftLint on each build if I were working on that project. Here're some random thoughts:
File
Violation
|
I'm using SwiftLint with a code base of around 30,000 lines of code (and growing). We have set up a build phase to run SwiftLint (and SwiftLint autocorrect) on every build. Some devs on the project are reporting that this takes a significantly long amount of time even when they have not modified any files.
On every run, SwiftLint could keep track of which files it checked or corrected and when. Then, on a future run, SwiftLint will determine if the .swiftlint.yml or the Swift file has been modified since the last run. If neither has been modified, SwiftLint will skip the file.
On a version update from SwiftLint, it should clear out these records so the first run of a new version of SwiftLint, it re-checks every file.
The text was updated successfully, but these errors were encountered: