Skip to content

Commit

Permalink
Set up nbqa pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Cooksley committed Dec 6, 2020
1 parent 94eaee9 commit 1990d31
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 26 deletions.
61 changes: 35 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://gitlab.com/pycqa/flake8
rev: master
hooks:
- id: flake8
args: ['src']
- repo: https://github.com/Yelp/detect-secrets
rev: v0.13.1
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: .*/tests/.*
- repo: https://github.com/aflc/pre-commit-jupyter
rev: v1.1.0
hooks:
- id: jupyter-notebook-cleanup
args:
- --remove-kernel-metadata
- --pin-patterns
- "[keep_output]"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-added-large-files
args: ['--maxkb=5120']
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 19.10b0 # Replace by any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
- repo: https://github.com/Yelp/detect-secrets
rev: v0.13.1
hooks:
- id: detect-secrets
args: ["--baseline", ".secrets.baseline"]
exclude: .*/tests/.*
- repo: https://github.com/aflc/pre-commit-jupyter
rev: v1.1.0
hooks:
- id: jupyter-notebook-cleanup
args:
- --remove-kernel-metadata
- --pin-patterns
- "[keep_output]"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-added-large-files
args: ["--maxkb=5120"]
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/nbQA-dev/nbQA
rev: 0.5.4
hooks:
- id: nbqa-black
additional_dependencies: [black==20.8b1]
- id: nbqa-pyupgrade
additional_dependencies: [pyupgrade==2.7.3]
- id: nbqa-isort
additional_dependencies: [isort==5.6.4]
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tool.nbqa.mutate]
isort = 1
black = 1
pyupgrade = 1

[tool.nbqa.addopts]
pyupgrade = ["--py36-plus"]

0 comments on commit 1990d31

Please sign in to comment.