-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
Replace pycodestyle by ruff in ci #36512
Conversation
I think we'll need info from @fchapoton, who's been working on pycodestyle fixes, whether removing pycodestyle outright is desirable. |
I don't know why this is marked as "disputed".... |
Documentation preview for this PR (built with commit e41f1e1; changes) is ready! 🎉 |
Of course you know why it's disputed. It is because it is based on #36503, which is grandstanding about create a pyproject.toml in SAGE_ROOT, which is problematic as explained there and elsewhere in detail. |
Since the "disputed" state on this PR is about a dependency and (apparently) not about this PR itself. I am removing the label since no vote is needed here. |
…H Actions: run `ruff-minimal` <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> `./sage -tox` and the GH Actions "Lint" workflow now additionally run `ruff-minimal`. The "Lint" workflow outputs GitHub annotations for view in the "Files changed" tab, as pioneered in sagemath#36512 (see screenshot there). Demo: https://github.com/sagemath/sage/pull/37456/files We use the built-in capability of ruff to output via `RUFF_OUTPUT_FORMAT=github` (no problem matcher is needed; see https://github.com/ChartBoost/ruff- action/issues/7#issuecomment-1887780308). (This has been adopted in the revised sagemath#36512.) sagemath#36512 (comment) is marked "disputed" because it builds upon the sagemath#36503, which bundles a controversial design choice, as explained in sagemath#37452. In further contrast to sagemath#36512, we do not remove the pycodestyle-minimal run from the "Lint" workflow. This can be done in a follow-up, once we have gained the necessary experience with the new linter (see previous info request in sagemath#36512 (comment)). Hence I am marking sagemath#36512 not as a "duplicate" but as "pending"; and "disputed" because of its dependency on the "disputed" sagemath#36503. @roed314 @vbraun And in further contrast to sagemath#36512, the minimal ruff configuration used by the CI can be used locally with `./sage -tox -e ruff-minimal` and also runs as part of the default tests in `./sage -tox`. Authors: @mkoeppe, @tobiasdiez (credit for the first version of the minimal ruff configuration taken from sagemath#36512, now regenerated) <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> - Depends on sagemath#37452 <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#37453 Reported by: Matthias Köppe Reviewer(s): Frédéric Chapoton, Kwankyu Lee, Matthias Köppe
…H Actions: run `ruff-minimal` <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> `./sage -tox` and the GH Actions "Lint" workflow now additionally run `ruff-minimal`. The "Lint" workflow outputs GitHub annotations for view in the "Files changed" tab, as pioneered in sagemath#36512 (see screenshot there). Demo: https://github.com/sagemath/sage/pull/37456/files We use the built-in capability of ruff to output via `RUFF_OUTPUT_FORMAT=github` (no problem matcher is needed; see https://github.com/ChartBoost/ruff- action/issues/7#issuecomment-1887780308). (This has been adopted in the revised sagemath#36512.) sagemath#36512 (comment) is marked "disputed" because it builds upon the sagemath#36503, which bundles a controversial design choice, as explained in sagemath#37452. In further contrast to sagemath#36512, we do not remove the pycodestyle-minimal run from the "Lint" workflow. This can be done in a follow-up, once we have gained the necessary experience with the new linter (see previous info request in sagemath#36512 (comment)). Hence I am marking sagemath#36512 not as a "duplicate" but as "pending"; and "disputed" because of its dependency on the "disputed" sagemath#36503. @roed314 @vbraun And in further contrast to sagemath#36512, the minimal ruff configuration used by the CI can be used locally with `./sage -tox -e ruff-minimal` and also runs as part of the default tests in `./sage -tox`. Authors: @mkoeppe, @tobiasdiez (credit for the first version of the minimal ruff configuration taken from sagemath#36512, now regenerated) <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> - Depends on sagemath#37452 <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#37453 Reported by: Matthias Köppe Reviewer(s): Frédéric Chapoton, Kwankyu Lee, Matthias Köppe
Not needed anymore |
Replace pycodestyle by ruff in the linter ci. It uses the rules added in #36503, but ignores all rules that are currently failing. Also adds problem matchers that surface the linter errors in the code/pr review display. This hopefully reduces the times that PRs are merged although the linter is failing for them.
Example:
As a nice plus, the linter now takes 5sec instead of 2mins
📝 Checklist
⌛ Dependencies