4 ms·
How can you make a linter for this?
by _ZeD_ 6y ago
How can you make a linter for this?
- alanbernstein 6y agoUse warnings for long lines instead of errors?
- erik_seaberg 6y agoIf the author thinks it's okay, and the reviewer thinks it's okay, a robot that can't actually understand code doesn't need a vote.
- SenHeng 6y agoThe reason for the robot is to have an impartial judge where neither author nor reviewer are okay with the opposing judgement. At the end of the day, a human’s judgement cycle is better reserved for something of a higher priority/use.
- erik_seaberg 6y agoBoth parties should be able to cede style arguments graciously. You can't really win the argument by quoting policy, only postpone the argument and burn team goodwill.
- pas 6y agoAnnotate the long line to ignore that particular linter rule. This makes it clear that it's not because the coder was lazy, ignorant, etc.
- zeroimpl 6y agoWouldn’t that make the code less readable? I think the point is that if 98% of your code fit under 110 chars when you weren’t using a linter, then maybe you don’t need a linter checking line length.
- pas 6y agoYou can disable the max line length rule too. I find linters helpful. Just yesterday it helped me catch a serious bug in Python. After fixing all linter warnings. The last one was a unused variable. Turns out it should have been used. Sure, the line length is not as severe as a unused var, but that's why the important thing is to have a systematic approach to thinking about maybe-problems that the "compiler" doesn't care about.