pymc-labs/CausalPy

Check pre-commit ruff formatting for notebooks is set up correctly

Closed this issue · 1 comments

I'm not 100% sure the pre-commit checks are fully/properly working for ruff formatting of notebooks. Currently we have:

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
hooks:
- id: ruff
args: ["--fix", "--output-format=full"]
- id: ruff-format
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.5
hooks:
- id: nbqa-ruff

Maybe we don't need nbQA at all and solely use ruff-pre-commit? The README at https://github.com/astral-sh/ruff-pre-commit shows that it's pretty simple to make it apply to Jupyter notebooks.

It is not necessary to use nbqa, the latest ruff pre-commit hooks support jupyter and pyi files directly. The third code block shows how: https://github.com/astral-sh/ruff-pre-commit