-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use Pylint to catch some mistakes #54
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We could add a -Dtests=false option which would actually remove this dependency, but currently if pytest is missing things will just break.
This runs the Pylint code checker.
The 'gi.require_versions()' call seems to trigger this warning, but we need to call that before importing from 'gi'.
I like having system imports after site-packages imports.
Some functions are self-documenting.
I can see by eye when the code is too complex, but I don't always have time to fiddle around with it trying to satisfy the linter.
In general constants should have UPPER CASE names, but it looks ugly if we call this one LOG.
Sometimes it looks clearer to explicitly write an 'else' clause, even if it's not strictly necessary.
Occasionally a single-letter argument name is nice to have.
This is unhelpful when we have callbacks from 3rd party libraries that supply parameters that we don't use.
…nings These are well intentioned, but I don't fancy fixing all that code right now.
The previous rule disallowed 'self.db' which is obviously a fine name.
This is mostly for long SQL queries.
This prevents us from grouping helper functions into classes.
I prefer to put whitespace after { } sometimes.
This is finding a false positive in modules that list the same imports.
This is just me being lazy really.
This fixes a pylint warning and is potentially more efficient, see: https://stackoverflow.com/questions/43121340/why-is-the-use-of-lensequence-in-condition-values-considered-incorrect-by-pyli
This also hides a pylint warning by dumping a variable to stdout. This code is unfinished anyway.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a
ninja pylint
target that can be run by developers, and fixes lots of warnings that were showing up (and disables lots more).Currently pylint is a hard dependency of calliope. In future it can be made optional, although a specific hard-disable flag would be best.