3 ms·
I want a linter where I can exclude specific things in some kind of configuration. Having linter hash tags in files is: - Ugly and makes for less readable code
by murgindrag 5y ago
I want a linter where I can exclude specific things in some kind of configuration. Having linter hash tags in files is:
- Ugly and makes for less readable code.
- Doesn't apply the same exception in similar situations. If I made an exception to a rule in one place, I'd like it to apply everywhere I have similar contexts.
- Gives a binary good / bad. A linter ought to flag questionable choices to look at -- not just bad choices. At that point, I should be able to say "oops, let me fix that," or "I meant to do that" without leaving garbage around.
I'd like this stuff in a linter config/data file, ideally, as semantically as possible. If I tell a spell checker that yes, in fact, my company name is a misspelling of a common word, I don't need to tell it twice. This is not true for linters.
I'd also like all the linty stuff configured in one place, with one syntax. Not pylint + pycodestyle.
Examples of use-cases:
- A lot of the times when I'm building an API, I have unused arguments in interim versions of the code. That's okay.
- I occasionally break Python naming conventions, especially when either planning a code refactor, or when trying to comply with non-Python naming conventions
- I generally dislike lines > 80 characters, but often, that's the right way to do things, especially if the alternative is breaking up a long token like a URL.
And so on. I'd like all of these caught, and then I'd like to give the linter a pat on the back, say "Thank you, but here it's okay," and move on with my life.
There's actually a lot more stuff which could be put into a linter once you assume that being wrong even 80% of the time still makes for a helpful tool. If a linter flags give things and I change one as a result, that's well worth the little bit of hassle. If a linter keeps flagging those things forever, it's no longer worth the hassle.
- zzzeek 5y agoflake8 is the most common linter front end and allows for exclusions/inclusions in configuration files. https://flake8.pycqa.org/en/latest/user/configuration.html https://flake8.pycqa.org/en/latest/user/configuration.html