Skip to content
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

Disable rule warnings/errors but still run rule with autocorrect #1667

Closed
scspijker opened this issue Jul 12, 2017 · 4 comments
Closed

Disable rule warnings/errors but still run rule with autocorrect #1667

scspijker opened this issue Jul 12, 2017 · 4 comments
Labels
question Question or doubts that needs discussion and clarification. Can become a bug or proposal.

Comments

@scspijker
Copy link

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.

@jpsim
Copy link
Collaborator

jpsim commented Jul 12, 2017

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

@scspijker
Copy link
Author

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.

@jpsim
Copy link
Collaborator

jpsim commented Jul 12, 2017

Yes, SwiftLint configs don't yet support merging/inheriting. That's tracked in #676.

@marcelofabri marcelofabri added the question Question or doubts that needs discussion and clarification. Can become a bug or proposal. label Jul 21, 2017
@marcelofabri
Copy link
Collaborator

Closing this for now since we already have several tickets tracking merging/inheriting/importing configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or doubts that needs discussion and clarification. Can become a bug or proposal.
Projects
None yet
Development

No branches or pull requests

3 participants