When we get certain warnings (mainly whitespace warnings), we don't want to get warned everytime, since Swiftlint can take care of this for us.
However, swiftlint autocorrect is not fast enough to run in the build process (we run it as a push hook).
I would like it if we could disable warnings / errors for a rule, but keep it enabled for swiftlint autocorrect.
You can do this if you use multiple SwiftLint configuration files.
# .swiftlint.yml
disabled_rules:
- trailing_whitespace
# .swiftlint-autocorrect.yml
whitelist_rules:
- trailing_whitespace
$ swiftlint lint --config .swiftlint.yml
$ swiftlint autocorrect --config .swiftlint-autocorrect.yml
Although this solution would work, it would require me to duplicate the normal set of rules, correct?
Because yaml does not support import/include statements.
Yes, SwiftLint configs don't yet support merging/inheriting. That's tracked in #676.
Closing this for now since we already have several tickets tracking merging/inheriting/importing configurations.
Most helpful comment
You can do this if you use multiple SwiftLint configuration files.