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
I'm not 100% sure the pre-commit checks are fully/properly working for ruff formatting of notebooks. Currently we have:
https://github.com/pymc-labs/CausalPy/blob/9a4daf7cb4b86c56c3f569a18f0212482c3a1986/.pre-commit-config.yaml#L26-L35
Maybe we don't need
nbQA
at all and solely useruff-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.