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

fix/Replace nbqa-ruff with ruff #3482

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.1"
rev: "v0.1.3"
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix, --ignore=E741, --exclude=__init__.py]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also move these configs to ruff.toml?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can i do that ?

if using docs i add this to ruff.toml it not works

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation for ruff.toml (https://docs.astral.sh/ruff/configuration/#using-rufftoml) mentions "though in the ruff.toml and .ruff.toml versions, the [tool.ruff] header is omitted", which should help

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test run smoothly but i don't have any effect on code even after i remove E703 from list of ignore.

it means after removing 10th line from pre-commit-config.yaml and improving ruff.toml is not working.

ruff.toml like this and with removed 10th line in pre-commit-config.yaml

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rjchauhan18, it would be easier for us to help you if you push your changes (don't worry about the CI failing once you push it - we can help you fix the CI, but it becomes challenging to help you without looking at your entire changes).

Also, avoid adding screenshots of your logs; instead, copy-paste them into markdown (good practice).


- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-ruff
additional_dependencies: [ruff==0.0.284]
args: ["--fix","--ignore=E501,E402"]

- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
hooks:
Expand Down
2 changes: 2 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[lint.per-file-ignores]
"**.ipynb" = ["E402", "E703"]