-
-
Notifications
You must be signed in to change notification settings - Fork 480
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 broken CI: add pre-commit checks for better CI #896
Fix broken CI: add pre-commit checks for better CI #896
Conversation
Codecov Report
@@ Coverage Diff @@
## master #896 +/- ##
=======================================
Coverage 97.83% 97.83%
=======================================
Files 22 22
Lines 1062 1062
Branches 162 162
=======================================
Hits 1039 1039
Misses 10 10
Partials 13 13
Continue to review full report at Codecov.
|
@jazzband/django-simple-history Team, CI has been broken for days. This PR fixes it, please, let's do something to make this project more efficient? All PRs require a review and virtually nobody is doing reviews. |
I'm fine with reordering imports. It's the single import per line that's
too verbose for my personal tastes.
Though I suppose that's why we use a linter.
|
Reasoning around splitting comma-separated imports: https://github.com/asottile/reorder_python_imports#why-this-style |
Thanks for sharing that @jeking3, I now understand the reasoning. I'm still on the fence regarding it, but I'm a curmudgeon. |
I'll remove that from pre-commit and undo the changes, and the churn should be much less on this PR. What I really want is to get CI running again so we can clear up 4-5 PRs, and hopefully get the as_of PR code reviewed. |
It looks like adding a blank pre-commit configuration will also get CI running again (such as the one I have in #900). I don't see what added that check to begin with.. |
7aa9795
to
c7e1d74
Compare
I removed the utf-8 stamping and import reordering that was previously there. This exercise did catch two tests identically named, so I fixed that up. A few cases where assert was used instead of self.assertSomething(). Bare asserts are generally to be avoided because they are not guaranteed to run depending on the runtime environment. That was caught by bandit. @tim-schilling take a look if you have a chance, I think you will find this more palatable. |
c7e1d74
to
adb505f
Compare
adb505f
to
0c2457f
Compare
I realized I had left a couple changes in runtests.py from the import reordering and utf-8 stamping before yesterday, so I just fixed that up. |
@tim-schilling take a look if you have a chance, I think you will find this more palatable. |
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.
Looks good!
It looks like pre-commit was added as a requirement for CI.
This caught a few issues, like having duplicate named test methods, so I fixed those up.
Description
I added a reasonable pre-commit configuration with black, flake8, and reformatting.
Related Issue
This fixes #869
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
make format
command to format my code (well, pre-commit...)AUTHORS.rst
CHANGES.rst