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

pre-commit hooks added/run for jupyter notebooks: nbstripout, nbqa-pyupgrade, nbqa-black, nbqa-flake8 #1654

Merged

Conversation

mathbunnyru
Copy link
Member

No description provided.

Comment on lines 108 to 118
- id: nbstripout

# py-like tools
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.3.1
hooks:
- id: nbqa-pyupgrade
args: [--py39-plus]
- id: nbqa-black
args: [--target-version=py39]
- id: nbqa-flake8
Copy link
Member Author

@mathbunnyru mathbunnyru Mar 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these hooks except flake automatically fix the files, so it should be easy to use them.

@mathbunnyru
Copy link
Member Author

mathbunnyru commented Mar 15, 2022

The only pre-commit hooks which I want to add later (in a separate PR) are:

  • requirements-txt-fixer
  • isort (and nbqa-isort)
  • forbid-tabs

I think that's probably everything that is possible to add to this repo.

.pre-commit-config.yaml Outdated Show resolved Hide resolved
@consideRatio consideRatio changed the title Run pre-commit hooks on jupyter notebooks pre-commit hooks added/run for jupyter notebooks: nbstripout, nbqa-pyupgrade, nbqa-black, nbqa-flake8 Mar 16, 2022
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
@mathbunnyru mathbunnyru merged commit 25add57 into jupyter:master Mar 16, 2022
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.

2 participants