pymc-labs / CausalPy

A Python package for causal inference in quasi-experimental settings
https://causalpy.readthedocs.io
Apache License 2.0
880 stars 63 forks source link

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

Closed drbenvincent closed 3 months ago

drbenvincent commented 4 months ago

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 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.

OriolAbril commented 3 months ago

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