Replace black/isort/pydocstyle with ruff in pre-commit configuration#457
Replace black/isort/pydocstyle with ruff in pre-commit configuration#457mahidhiman12 wants to merge 10 commits intoarviz-devs:mainfrom
Conversation
|
@OriolAbril I've opened this as a draft PR with the config changes and ruff auto-fixes applied following the workflow you suggested. Before I proceed to fix the remaining manual errors (PLW1508 and D400), could you let me know if the [tool.ruff] settings in pyproject.toml look correct, or if anything needs tweaking? I want to make sure the config is finalized before committing more fixes on top of it. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #457 +/- ##
==========================================
- Coverage 85.17% 85.16% -0.02%
==========================================
Files 60 60
Lines 7069 7062 -7
==========================================
- Hits 6021 6014 -7
Misses 1048 1048 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
OriolAbril
left a comment
There was a problem hiding this comment.
Going over the logs to see the reasons why the checks failed:
- end of files and trailing whitespaces are fine, there will be changes to many files but it is no problem
- new per file ruff ignores
- Any "D" related message should be ignored for anything inside
docs/source/gallery, theE501one (line too long) should be ignored too. After removing those please check what errors you still get from files inside that folder so we can see if they are relevant or should be ignored too.
- Any "D" related message should be ignored for anything inside
- either more per-file ignores or within file
noqacomments- Things like
Link to this page with the [bokeh tab selected]({site_url}/gallery/{basename}.html?backend=bokeh#synchronised-tabs)in the gallery generator are ok and should be kept as is not trigger errors or be reformatted
- Things like
- ...
There are too many errors for now. You should run tox -e check twice with the updated settings (so the formatter and auto fixer takes care of some of the errors) then commit so we can focus on the non-automatically fixable issues. If you do this commit idependently from the config settings if we see the formatter ended up being too agressive you can undo only the commit with the automatic changes while keeping everything else.
|
Updated the hook name to ruff-check, bumped to latest version (v0.15.6), and added per-file ignores for docs/source/gallery and docs/sphinxext. |
|
I would put this on hold for it to be fixed during GSoC. Nearly 400 errors to fix manually across so many files is a lot of work and will generate many merge conflicts across the board. |
Closes #451
Changes
black,isort, andpydocstylepre-commit hooks withruffandruff-formatin.pre-commit-config.yamlpyproject.tomlto remove[tool.black],[tool.isort],[tool.pydocstyle]sections and add[tool.ruff]config aligned with arviz-basepylintas ruff does not replace its checksStatus
.pre-commit-config.yaml,pyproject.toml)Marking as draft while final fixes are completed.