-
Notifications
You must be signed in to change notification settings - Fork 50
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
Pylint alerts corrections as part of intervention experiment #81 #82
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
Line was one letter too long
if result_proxy.fetchall() == [(123,)] can result in only True or False, the external condition is not needed. However, if result_proxy.fetchall() might return Noe, the external condition can translate it to False. The external condition hurt readability since it takes a bit to verify what it does. bool is a simpler implementation See https://stackoverflow.com/questions/76094401/the-if-expression-can-be-replaced-with-test-simplifiable-if-expression
Code deliberately catches Exception, after catching KeyboardInterrupt. However, looking at the protected code it seems that no other exception can be raised. Hence, instead of narrowing the exception, I removed it.
Made the long, yet readable, comment shorter
Code deliberately catches Exception, after catching KeyboardInterrupt. However, looking at the protected code it seems that no other exception can be raised. Hence, instead of narrowing the exception, I removed it.
Exception is too wide. os.path.exists does not throw exceptions. os.makedirs might throw OSError (e.g., in a bad path). See https://stackoverflow.com/questions/2383816/how-can-i-make-an-error-verifiy-with-os-makedirs-in-python As extra safety, though the code checks just before for the directory, catch it too in case a different process will be able to create it before.
Replaced (True) to True
Made a readable comment line shorter
Made the line shorter. Since the string is also formatted, parenthesis are added for operations precedence.
gabfl
approved these changes
Sep 25, 2024
This was referenced Oct 8, 2024
This was referenced Nov 3, 2024
Closed
This was referenced Nov 10, 2024
Open
This was referenced Nov 13, 2024
Open
This was referenced Nov 20, 2024
This was referenced Nov 27, 2024
Open
Open
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.
I fixed the planed interventions
In few cases the alert was not justified, so I left it as "won't fix".
Each intervention is in a commit of its own, having the file and alert in the title.
The message explains and justify the change.