Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds nbQA to pre-commit hooks #1048

Merged
merged 4 commits into from
Dec 12, 2024
Merged

Adds nbQA to pre-commit hooks #1048

merged 4 commits into from
Dec 12, 2024

Conversation

ns-rse
Copy link
Collaborator

@ns-rse ns-rse commented Dec 11, 2024

Closes #1038

Opted not to apply nbqa-mypy for type hints in Notebooks and have disabled nbqa-pylint for the time being. The later
because the environment doesn't have all the dependencies included and so pylint complains about not being able to
import topostats. modules

Checked all hooks pass and linted the existing notebooks where required, the exception is a single equality condition
used to subset a Pandas Dataframe which I feel is a false-positive. Complaints about a couple of other variables but I can't see how to address those.

Sets max-line-length to 120 for flake8 via tox.ini..

TopoStats Pull Requests

  • Pre-commit checks pass (well almost, there are a couple of failures, see above comment)

Opted not to apply `nbqa-mypy` for type hints in Notebooks and have disabled `nbqa-pylint` for the time being.
Applied some of the linting rules that `pylint` reported but not all, the environment used doesn't have TopoStats
installed and so fails (just as `pylint` would fail in `pre-commit.ci` and is therefore configured as `local` only).

Have opted to remove `nbqa-pylint` hook but have removed unused imports from Notebooks.
Sets `max-line-length` to 120 for `flake8` via `tox.ini` and addresses most other errors reported by `flake8`. The
exception is a single equality condition used to subset a Pandas Dataframe.
@ns-rse ns-rse merged commit adbd3b7 into main Dec 12, 2024
10 of 11 checks passed
@ns-rse ns-rse deleted the ns-rse/1038-nbqa-pre-commit branch December 12, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add nbQA pre-commit hook and lint existing notebooks
4 participants