-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
CI add pre-commit, check notebook imports are sorted #4088
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4088 +/- ##
=======================================
Coverage 88.48% 88.48%
=======================================
Files 88 88
Lines 13865 13865
=======================================
Hits 12268 12268
Misses 1597 1597 |
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 super nice and should make our lives easier, thanks a lot @MarcoGorelli 🎉
Approving but will merge a bit later, in case somebody else wants to comment.
Just had a couple questions:
- the
pre-commit.yml
file looks a bit esoteric to me -- does it come from a standard configuration or something like that? - Does the line
rev: 0.1.29
in.pre-commit-config.yaml
mean that the commit hook will stay with this version of nbqa instead of just using the latest? - Also, can you update the NB style guide accordingly once this PR is merged?
Thanks Alex!
Yes, it's for pre-commit. If you install it, then any time you make a commit, pre-commit checks will run against the files you modified. If you don't install it, then the checks will just run during CI and won't interfere with the rest of your development. We use it in pandas https://github.com/pandas-dev/pandas/blob/master/.pre-commit-config.yaml , I find it to be a really great tool.
If you run
Would love to but I don't think I have permission to do so |
Sorry, my bad, you were asking about |
Ha ha, indeed, this looks much better 😆 Thanks for updating! |
@AlexAndorra you're right, I was able to update it, and so have done so - thanks! |
Thanks @MarcoGorelli , looks good! Do you mind also adding a line about the new pre-commit GitHub Action you set up? |
Sure, done @AlexAndorra - I also indented the paragraphs so markdown formats them in a more readable manner |
Awesome, thanks again @MarcoGorelli ! Now that I think about it, it seems like we can also Black-format the NBs with nbqa, can't we? If so, we may as well add a GitHub action for that too -- would get rid of the 4th step in the style guide |
closes #4077
This allows the check to be carried out without requiring users to add pre-commit, nbqa, or isort to the dev requirements.
Also, it means that once #4083 is merged, you can easily add
to
.pre-commit-config.yaml
, and similarly for any other code-quality tool (e.g.black
,flake8
, you name it...) you decide to add to this amazing repo