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

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

Closed
drbenvincent opened this issue May 8, 2024 · 1 comment · Fixed by #352
Closed

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

drbenvincent opened this issue May 8, 2024 · 1 comment · Fixed by #352
Assignees
Labels
devops DevOps related good first issue Good for newcomers

Comments

@drbenvincent
Copy link
Collaborator

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.

@OriolAbril
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops DevOps related good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants