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

error severity for every rule #1249

Closed
HunorSzabo opened this issue Jan 25, 2017 · 6 comments
Closed

error severity for every rule #1249

HunorSzabo opened this issue Jan 25, 2017 · 6 comments
Labels
question Question or doubts that needs discussion and clarification. Can become a bug or proposal.

Comments

@HunorSzabo
Copy link

HunorSzabo commented Jan 25, 2017

I couldn't find an answer in the Wiki about failing the build in case of any of the rules are violated. I am not sure this is the right place to ask for clarification, but what I would like to do is to fail the build for the violation of any of the rules which are not disabled. e.g. todo, trailing_comma, valid_docs, etc.. basically almost every rule violation should fail the build.

What would be the way of doing this properly?

Thanks you for your suggestions, I'm not sure if this is the proper place for asking this type of question, but feel free to move my issue.

@marcelofabri
Copy link
Collaborator

You can use swiftlint lint --strict. See #834.

@marcelofabri marcelofabri added the question Question or doubts that needs discussion and clarification. Can become a bug or proposal. label Jan 25, 2017
@HunorSzabo
Copy link
Author

Perfect, thanks for your help and the quick reply.

@marcelofabri
Copy link
Collaborator

Feel free to reopen if you have more questions!

@fabb
Copy link
Contributor

fabb commented Jul 23, 2018

--strict is nice, but it would be even nicer to be able to be able to set error as default for every rule via .swiftlint.yml and turn it down to warning for selected other rules.
Use case: For a commit hook which only runs on added/modified files, we like to be strict and have a lot of errors which prevent committing. For the whole code base, reports are generated on CI, it should include more finegrained reports including warnings for rules that should be ignored or have a higher threshold on the commit hook. E.g. warn for method body lines > 40, error for > 100.

@rolandleth
Copy link

@marcelofabri I was looking for the same thing as @fabb suggested. Any plans on adding such a feature? Would be really nice.

@fabb
Copy link
Contributor

fabb commented Feb 17, 2020

For inspiration: and eslint supports --max-warnings=0 as a command line parameter.
https://eslint.org/docs/user-guide/command-line-interface

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

4 participants