Skip to content
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: Use black-jupyter pre-commit hook over nbqa-black #304

Merged
merged 3 commits into from Sep 12, 2021

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Sep 12, 2021

As noted in #276 (comment) there is now a black[jupyter] extra that allows for Black to run on Jupyter notebooks. nbqa-black does this, but Marco Gorelli contributed this functionality to Black so now the black-jupyter hook will be the equivalent hook as running black and nbqa-black.

c.f. scikit-hep/pyhf#1598 for more details / an example

Suggested squash and merge commit message

* Use jupyter-black pre-commit hook id from Black
   - black-jupyter will run on Python and pyi files, so it replaces the black hook id as well
* Remove nbqa-black pre-commit hook from nbQA
   - Marco Gorelli essentially contributed nbqa-black to Black in the form of jupyter-black
* Update the pyupgrade version used as an additional_dependencies to match that of the pyupgrade hook

@matthewfeickert matthewfeickert self-assigned this Sep 12, 2021
@matthewfeickert matthewfeickert changed the title chore: Use jupyter-black pre-commit hook over nbqa-black chore: Use black-jupyter pre-commit hook over nbqa-black Sep 12, 2021
@henryiii
Copy link
Member

Nice, I knew they added support, but didn't realize the pre-commit integration was so good. I didn't even know types_or was already being used. :) scikit-hep/boost-histogram#638

@henryiii henryiii merged commit 0d82f0b into main Sep 12, 2021
@henryiii henryiii deleted the chore/use-black-jupyter branch September 12, 2021 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants