3 ms·
i think the key point is that the linter doesn't ban anything. nobody is proposing removing while statements from the language. if you have a valid case for d
by notatoad 5y ago
i think the key point is that the linter doesn't ban anything. nobody is proposing removing while statements from the language. if you have a valid case for disobeying the linter, then you can disable the linter for that line: https://pylint.pycqa.org/en/latest/user_guide/message-control.html https://pylint.pycqa.org/en/latest/user_guide/message-contro...
(if a project unconditionally bans PRs that don't pass the linter, that's a different issue, and not really the linter's fault)
- mst 5y agoI could certainly see a linter that says "are you sure?" before you initially add a while loop to make you ask yourself if that's really the best option being quite neat. The trick would be making it sufficiently useful and minimally annoying that people don't get angry and turn it off.
- notatoad 5y agoit's not really the linter's job to say "are you sure". the linter just applies the rules and generates messages, it's up to you to do with those messages what you will when using the python integration in vscode (which runs pylint), clicking on a linter error gives me a context menu where one of the options is essentially "are you sure?" and will automatically adds the appropriate comment to disable the linter for that line.
- mst 5y agoI was thinking along the lines of something similar except for running the linter as a pre-commit hook.