-
-
Notifications
You must be signed in to change notification settings - Fork 460
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
Expand on and restructure pre_push.py #1157
Conversation
I'm just weighing in with my personal opinion, so don't take this as a PR review.
Could this be optional? Maybe via a command-line option like Or, alternatively, could there be an option to do style checks only? Such as |
…yle checks only running.
This is the solution. I understand having |
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.
A few minor suggestions, otherwise I really like this improvement. Great work!
pre_push.py
Outdated
@@ -1,9 +1,14 @@ | |||
#!/usr/bin/env python3 | |||
"""Run static analysis on the project.""" | |||
|
|||
import sys | |||
|
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.
There needn't be this blank line here. Also argparse should be just before import sys
.
pre_push.py
Outdated
where any failed tests cause pre_push.py to fail. | ||
""" | ||
curdir = path.abspath(path.join(__file__, "..")) | ||
return do_process([sys.executable, curdir + "/setup.py", "test"]) |
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.
Can you use "".format
here rather than string concatenation? I'm actually more partial to f-strings now, however, python 3.5 doesn't support them, and it's not EOL until September 2020.
Thanks! 🎆 |
I feel that there is no reason for pre_push.py to not run the unit tests, so I added in a command to run the unit tests.
I also moved around imports and changed the return of the main function to be the int of the opposite of the value of success (True=0 and False=1).