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 pylint #77
Merged
Merged
Fix pylint #77
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
@bdrung Impressive work, many thanks! |
pylint complains: Do not use `len(variable)` to determine if a sequence is empty (len-as-condition).
pylint complains about string statement that have no effect. Convert these statements to comments (as they were intended).
pylint complains: Consider iterating the dictionary directly instead of calling .keys() (consider-iterating-dictionary) Since the value of the dictionary items are also required, iterate over the dictionary items instead of just the dictionary keys.
pylint complains: Anomalous backslash in string: '\d'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
pylint complains: Unnecessary parens after 'return' or 'if' keyword (superfluous-parens)
pylint complains: Using type() instead of isinstance() for a typecheck. (unidiomatic-typecheck)
To avoid pylint to complain about no-name-in-module, use relative imports for the tests helpers. Also group the imports by standard, 3rd party, profitbricks, and relative imports.
pylint complains: Class method setUpClass/tearDownClass should have 'cls' as first argument (bad-classmethod-argument)
pylint complains: Redefining name 'resource' from outer scope (redefined-outer-name)
The functions read_dc_definition and write_dc_definition have an unused argument pbclient. Remove this unused argument.
pylint complains: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) Add useful return values in case the function is executed until the end.
pylint complains: Dangerous default value [] as argument (dangerous-default-value)
pylint complains: Statement seems to have no effect (pointless-statement). These statements are just used to check whether the environment variable is defined.
pylint complains: Unnecessary "else" after "return" (no-else-return)
Some pylint issues are not important and would make the examples less readable.
Third party imports should be placed before its own library imports. Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
Please review the changes. Otherwise I will merge them without the additional review. |
No comment received. Merged to master. |
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.
Address comment 655beab#commitcomment-30676385 and make the code comply to pylint.