tox.ini: Add environments ruff, ruff-minimal; GH Actions: run ruff-minimal#37453
Merged
vbraun merged 9 commits intosagemath:developfrom May 25, 2024
Merged
tox.ini: Add environments ruff, ruff-minimal; GH Actions: run ruff-minimal#37453vbraun merged 9 commits intosagemath:developfrom
ruff, ruff-minimal; GH Actions: run ruff-minimal#37453vbraun merged 9 commits intosagemath:developfrom
Conversation
Contributor
|
I am not experienced with tox, but the form of the setup looks good to me. |
Contributor
Author
|
Rebased. |
|
Documentation preview for this PR (built with commit c97451d; changes) is ready! 🎉 |
kwankyu
reviewed
Apr 30, 2024
| # 1 PLC0208 [*] Use a sequence type instead of a `set` when iterating over values | ||
| # | ||
| commands = ruff --ignore I001,PLR2004,F401,E741,F821,PLR0912,PLR0913,E402,PLR0915,PLW2901,PLR5501,PLR0911,E731,F405,PLR1714,F403,PLR0402,PLW0603,E713,F841,PLW0602,E714,PLR1711,PLR1701,PLW3301,E721,PLW1510,F811,PLW0120,PLC0414,E743,F541,PLE0101,PLR0124,PLW0127,PLW1508,PLC3002,E742,PLE0302,F402,PLC0208,PLW0129 {posargs:{toxinidir}/sage/} | ||
|
|
Collaborator
There was a problem hiding this comment.
How about making the list in line 300 is ordered the same with the list above, for easy maintenance?
kwankyu
reviewed
Apr 30, 2024
| # 3579 PLR2004 [ ] Magic value used in comparison, consider replacing `- 0.5` with a constant variable | ||
| # 3498 I001 [*] Import block is un-sorted or un-formatted | ||
| # 2146 F401 [*] `.PyPolyBoRi.Monomial` imported but unused | ||
| # 1964 E741 [ ] Ambiguous variable name: `I` |
Contributor
There was a problem hiding this comment.
the star usually means auto-fixable
Collaborator
|
I get Note the warning. |
…tings are deprecated in favour of their counterparts in the lint section.'
…date ignored codes
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
May 18, 2024
sagemathgh-37453: tox.ini: Add environments `ruff`, `ruff-minimal`; GH 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
./sage -toxand the GH Actions "Lint" workflow now additionally runruff-minimal.The "Lint" workflow outputs GitHub annotations for view in the "Files changed" tab, as pioneered in #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 ChartBoost/ruff-action#7 (comment)). (This has been adopted in the revised #36512.)#36512 (comment) is marked "disputed" because it builds upon the #36503, which bundles a controversial design choice, as explained in #37452.
In further contrast to #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 #36512 (comment)). Hence I am marking #36512 not as a "duplicate" but as "pending"; and "disputed" because of its dependency on the "disputed" #36503. @roed314 @vbraun
And in further contrast to #36512, the minimal ruff configuration used by the CI can be used locally with
./sage -tox -e ruff-minimaland 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 #36512, now regenerated)
📝 Checklist
⌛ Dependencies