-
Notifications
You must be signed in to change notification settings - Fork 519
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
chore : Fixed code quality issues #1300
Conversation
- Added .deepsource.toml to fix bug risks - Remove unnecessary use of comprehension - Use `os.environ.copy()` to copy the environment variables - Remove unnecessary return statement - Use `sys.exit()` calls
@AndreMiras kindly review . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR 🙏
I'm just unsure about the bundling the .deepsource.toml
file here since we don't use it with our CI and already have flake8.
@@ -55,7 +55,7 @@ def download_kivy(self, cwd, py_branch=2): | |||
"Unable to download the Kivy App. Check osx.kivy_version in your buildozer.spec, and verify " | |||
"Kivy servers are accessible. http://kivy.org/downloads/") | |||
check_call(("rm", "Kivy{}.dmg".format(py_branch)), cwd=cwd) | |||
exit(1) | |||
sys.exit(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't clear to me why this wasn't caught earlier at least by flake8, but actually site.exit
seems to be imported by default. Using the correct sys.exit
is not a bad idea still, so thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @AndreMiras .
@@ -0,0 +1,25 @@ | |||
version = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to think about having that linter config there, but not using it anywhere except in your local setup.
Also I don't know about adding another linter when we already have flake8.
Not completely against, simply thinking out loud
@@ -76,8 +76,6 @@ def ensure_kivyapp(self): | |||
else: | |||
self.download_kivy(kivy_app_dir, py_branch) | |||
|
|||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've always been bugged by that, but I think we have more in the code base here or in p4a so I didn't dare to touch it 😅
I'm happy to remove it still if it comes from someone else 😛
Thanks @AndreMiras ! |
I'm curious to know what @tshirtman thinks about it regarding the |
I don't really have an opinion on that, if we it helps keeping track of future similar issues through the service, and we plan to maybe integrate that in the CI, then why not? :) |
Thanks @AndreMiras @tshirtman . Activating analysis will help you to continuously analyze repo for code quality issues and fix commonly occurring issues using the auto-fix feature. I would like to share some steps to activate DeepSource :
|
Hey , @AndreMiras , @tshirtman Please have a look. |
Description
Hi 👋 I ran the DeepSource static analyzer on the forked copy of this repo and found some interesting code quality issues. This PR fixes a few of them.
Summary of Fixes
os.environ.copy()
to copy the environment variablessys.exit()
callsType of change
Checklist: