-
-
Notifications
You must be signed in to change notification settings - Fork 554
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should specifically use ruff.toml
(docs) instead of pyproject.toml
for now, since PyBaMM is not configured to support the pyproject.toml
build format yet
|
ruff.toml
Outdated
[lint] | ||
ignore = ["E402","E703"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[lint] | |
ignore = ["E402","E703"] | |
[lint.per-file-ignores] | |
**.ipynb = ["E402", "E703"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay it work if we use double quote and then **.ipynb inside it.
[lint.per-file-ignores]
"**.ipynb" = ["E402", "E703"]
hooks: | ||
- id: ruff | ||
types_or: [python, pyi, jupyter] | ||
args: [--fix, --ignore=E741, --exclude=__init__.py] |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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).
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3482 +/- ##
========================================
Coverage 99.58% 99.58%
========================================
Files 256 256
Lines 20048 20048
========================================
Hits 19965 19965
Misses 83 83 ☔ View full report in Codecov by Sentry. |
Note: this PR (like the earlier one as @Saransh-cpp had mentioned) is also from the |
so do you want that i make PR from new branch? and close this one. |
Yes. You can cherry-pick the commits that are already here so that you don't lose any progress |
No need to cherry-pick, you can simply checkout to a new branch, push the changes, and create a new PR -
This might look a bit intimidating at start but you'll get used to the commands as you work more with git 🙂 |
Closing since #3483 has been opened |
Description
.pre-commit-config.yaml
file and added ruff.toml for lint the jupyter notebook.Fixes # (issue)
nbqa-ruff
withruff
#3476Type of change
Key checklist:
$ pre-commit run
(or$ nox -s pre-commit
) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ python run-tests.py --all
(or$ nox -s tests
)$ python run-tests.py --doctest
(or$ nox -s doctests
)You can run integration tests, unit tests, and doctests together at once, using
$ python run-tests.py --quick
(or$ nox -s quick
).Further checks: