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

Fix usage of pylint exceptions #662

Open
2 tasks
vkucera opened this issue Apr 26, 2020 · 1 comment
Open
2 tasks

Fix usage of pylint exceptions #662

vkucera opened this issue Apr 26, 2020 · 1 comment
Labels
code quality enhancement New feature or request

Comments

@vkucera
Copy link
Contributor

vkucera commented Apr 26, 2020

# pylint: disable= exceptions are overused and misused.

  • Fix warnings that can be fixed.
  • Use the remaining exceptions only within the scope where they are supposed to apply, i.e.

    at the desired block level or at the end of the desired line of code

See documentation and FAQ for more details.

@benedikt-voelkel
Copy link
Contributor

Indeed @vkucera
Thanks for bringing that up!
Maybe some explanation for everyone: pylint can be used to do different kinds of automatic code (quality) checks, varying from layout to some functional checks.
It is super useful to have pylint checking the code so we don't need to all those things by hand. Of course, sometimes, one really wants something to look/work in a very specific way and there are always exceptions to the rules (as usual...): In those cases we use # pyliint: disable=<warning/error-code>
However, overusing/misuse makes the entire pylint business useless, so only disable if you are absolutely certain about it. If not (or you don't understand a certain pylint warning) you can ask me anytime.
Long story short: Whenever you work on a code-snippet in the future, it would be awesome to validate the usage of # pylint: disable= statements

@benedikt-voelkel benedikt-voelkel added enhancement New feature or request code quality labels Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants