A few days ago I ran into a situation where we decided to start rejecting some code using linter, the decision has been made, pull request is open, and all that’s left is to merge these changes. But the rule that was added is marked as a warning. This fact confused me a little bit, that’s why…

Definitely

Purpose of linter

In my opinion, linter, which is built into CI/CD pipeline, has several goals. One of them – be a teacher for programmer. In moment when you’re setting up the pipeline, you’re adding specific rules that come from your experience. You’re describing how code should be written in this project and thereby you’re sharing your expertise, knowledge, best practices, etc. through CI/CD. Coming back to warnings, it means that warnings create uncertainty by pointing out an error and allowing the build to succeed. I mean, it’s like we’re saying this is bad, but we’re going to let you merge pull request, which is pretty controversial, isn’t it? And the programmer in your project continues to write the code that generates these warnings, which means that he will just get used to writing code that smells in your project.