[ruff-0.8] Spruce up docs for newly stabilised rules#14466
Merged
AlexWaygood merged 2 commits intoruff-0.8from Nov 20, 2024
Merged
[ruff-0.8] Spruce up docs for newly stabilised rules#14466AlexWaygood merged 2 commits intoruff-0.8from
AlexWaygood merged 2 commits intoruff-0.8from
Conversation
CodSpeed Performance ReportMerging #14466 will not alter performanceComparing Summary
|
Member
Author
Fake news! This PR only touches docs |
Contributor
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| RUF023 | 167 | 167 | 0 | 0 | 0 |
| RUF022 | 145 | 145 | 0 | 0 | 0 |
| PLC0206 | 43 | 43 | 0 | 0 | 0 |
| PYI063 | 5 | 5 | 0 | 0 | 0 |
| B039 | 4 | 4 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+36 -36 violations, +0 -0 fixes in 6 projects; 48 projects unchanged)
apache/airflow (+5 -5 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
- airflow/utils/hashlib_wrapper.py:27:9: PYI063 Use PEP 570 syntax for positional-only arguments + airflow/utils/hashlib_wrapper.py:27:9: PYI063 Use PEP 570 syntax for positional-only parameters + providers/src/airflow/providers/cloudant/hooks/cloudant.py:25:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - providers/src/airflow/providers/cloudant/hooks/cloudant.py:25:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + providers/tests/cloudant/hooks/test_cloudant.py:30:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - providers/tests/cloudant/hooks/test_cloudant.py:30:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + providers/tests/google/cloud/utils/test_mlengine_prediction_summary.py:27:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - providers/tests/google/cloud/utils/test_mlengine_prediction_summary.py:27:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons ... 3 additional changes omitted for rule PYI066
pandas-dev/pandas (+3 -3 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
- pandas/_typing.py:276:20: PYI063 Use PEP 570 syntax for positional-only arguments + pandas/_typing.py:276:20: PYI063 Use PEP 570 syntax for positional-only parameters - pandas/_typing.py:291:20: PYI063 Use PEP 570 syntax for positional-only arguments + pandas/_typing.py:291:20: PYI063 Use PEP 570 syntax for positional-only parameters - pandas/_typing.py:297:21: PYI063 Use PEP 570 syntax for positional-only arguments + pandas/_typing.py:297:21: PYI063 Use PEP 570 syntax for positional-only parameters
pypa/cibuildwheel (+2 -2 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ bin/bump_version.py:20:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - bin/bump_version.py:20:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + cibuildwheel/_compat/typing.py:5:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - cibuildwheel/_compat/typing.py:5:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
pypa/setuptools (+1 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ setuptools/_importlib.py:3:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - setuptools/_importlib.py:3:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons
scikit-build/scikit-build-core (+19 -19 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ docs/conf.py:16:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - docs/conf.py:16:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/scikit_build_core/_compat/builtins.py:5:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/scikit_build_core/_compat/builtins.py:5:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/scikit_build_core/_compat/importlib/metadata.py:15:8: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/scikit_build_core/_compat/importlib/metadata.py:15:8: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/scikit_build_core/_compat/importlib/metadata.py:17:10: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/scikit_build_core/_compat/importlib/metadata.py:17:10: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/scikit_build_core/_compat/importlib/metadata.py:6:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/scikit_build_core/_compat/importlib/metadata.py:6:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/scikit_build_core/_compat/importlib/resources.py:5:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/scikit_build_core/_compat/importlib/resources.py:5:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/scikit_build_core/_compat/tomllib.py:5:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/scikit_build_core/_compat/tomllib.py:5:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/scikit_build_core/_compat/typing.py:14:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/scikit_build_core/_compat/typing.py:14:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/scikit_build_core/_compat/typing.py:19:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/scikit_build_core/_compat/typing.py:19:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/scikit_build_core/_compat/typing.py:6:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/scikit_build_core/_compat/typing.py:6:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/scikit_build_core/_logging.py:80:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/scikit_build_core/_logging.py:80:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/scikit_build_core/builder/sysconfig.py:179:8: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/scikit_build_core/builder/sysconfig.py:179:8: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/scikit_build_core/file_api/reply.py:76:24: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/scikit_build_core/file_api/reply.py:76:24: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons ... 12 additional changes omitted for project
pytest-dev/pytest (+6 -6 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/_pytest/_code/code.py:699:16: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/_pytest/_code/code.py:699:16: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/_pytest/assertion/rewrite.py:299:16: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/_pytest/assertion/rewrite.py:299:16: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons + src/_pytest/pathlib.py:41:4: PYI066 Put branches for newer Python versions first when branching on `sys.version_info` comparisons - src/_pytest/pathlib.py:41:4: PYI066 Use `>=` when using `if`-`else` with `sys.version_info` comparisons ... 5 additional changes omitted for rule PYI066 - testing/example_scripts/dataclasses/test_compare_dataclasses_with_custom_eq.py:13:26: PYI063 Use PEP 570 syntax for positional-only arguments + testing/example_scripts/dataclasses/test_compare_dataclasses_with_custom_eq.py:13:26: PYI063 Use PEP 570 syntax for positional-only parameters ... 4 additional changes omitted for project
Changes by rule (2 rules affected)
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| PYI066 | 62 | 31 | 31 | 0 | 0 |
| PYI063 | 10 | 5 | 5 | 0 | 0 |
MichaReiser
approved these changes
Nov 20, 2024
AlexWaygood
commented
Nov 20, 2024
crates/ruff_linter/src/rules/pyupgrade/rules/unnecessary_default_type_args.rs
Outdated
Show resolved
Hide resolved
MichaReiser
pushed a commit
that referenced
this pull request
Nov 20, 2024
## Summary - Expand some docs where they're unclear about the motivation, or assume some knowledge that hasn't been introduced yet - Add more links to external docs - Rename PYI063 from `PrePep570PositionalArgument` to `Pep484StylePositionalOnlyParameter` - Rename the file `parenthesize_logical_operators.rs` to `parenthesize_chained_operators.rs`, since the rule is called `ParenthesizeChainedOperators`, not `ParenthesizeLogicalOperators` ## Test Plan `cargo test`
MichaReiser
pushed a commit
that referenced
this pull request
Nov 20, 2024
## Summary - Expand some docs where they're unclear about the motivation, or assume some knowledge that hasn't been introduced yet - Add more links to external docs - Rename PYI063 from `PrePep570PositionalArgument` to `Pep484StylePositionalOnlyParameter` - Rename the file `parenthesize_logical_operators.rs` to `parenthesize_chained_operators.rs`, since the rule is called `ParenthesizeChainedOperators`, not `ParenthesizeLogicalOperators` ## Test Plan `cargo test`
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.
Summary
PrePep570PositionalArgumenttoPep484StylePositionalOnlyParameterparenthesize_logical_operators.rstoparenthesize_chained_operators.rs, since the rule is calledParenthesizeChainedOperators, notParenthesizeLogicalOperatorsTest Plan
cargo test