dianna
dianna copied to clipboard
Add linting for jupyter notebooks
I came across this library recently: https://github.com/nbQA-dev/nbQA
With it, you can lint notebooks with the same tools you use to lint regular python files.
Adding this snippet to .pre-commit-config.yaml
enables yapf
/ ruff
.
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-yapf
additional_dependencies: [toml, yapf]
types_or: [jupyter]
- id: nbqa-ruff
args: [--fix, --ignore=E402]
types_or: [jupyter]