-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Release v0.2.0 #9680
Merged
Merged
Release v0.2.0 #9680
Conversation
This file contains 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
This comment was marked as outdated.
This comment was marked as outdated.
zanieb
added a commit
that referenced
this pull request
Jan 29, 2024
This was referenced Jan 30, 2024
zanieb
added a commit
that referenced
this pull request
Jan 30, 2024
Similar to #9689 — retains removed rules for better error messages and documentation but removed rules _cannot_ be used in any context. Removes PLR1706 as a useful test case and something we want to accomplish in #9680 anyway. The rule was in preview so we do not need to deprecate it first. Closes #9007 ## Test plan <img width="1110" alt="Rules table" src="https://github.com/astral-sh/ruff/assets/2586601/ac9fa682-623c-44aa-8e51-d8ab0d308355"> <img width="1110" alt="Rule page" src="https://github.com/astral-sh/ruff/assets/2586601/05850b2d-7ca5-49bb-8df8-bb931bab25cd">
zanieb
added a commit
that referenced
this pull request
Jan 30, 2024
Similar to #9689 — retains removed rules for better error messages and documentation but removed rules _cannot_ be used in any context. Removes PLR1706 as a useful test case and something we want to accomplish in #9680 anyway. The rule was in preview so we do not need to deprecate it first. Closes #9007 ## Test plan <img width="1110" alt="Rules table" src="https://github.com/astral-sh/ruff/assets/2586601/ac9fa682-623c-44aa-8e51-d8ab0d308355"> <img width="1110" alt="Rule page" src="https://github.com/astral-sh/ruff/assets/2586601/05850b2d-7ca5-49bb-8df8-bb931bab25cd">
CodSpeed Performance ReportMerging #9680 will degrade performances by 8.82%Comparing Summary
Benchmarks breakdown
|
#9679) ## Summary Prompted by #8482 (comment). The rename is only unsafe when the symbol is exported, so we can narrow the conditions.
…9428) ## Summary This rule was added to flake8-bugbear. In general, we tend to prefer redirecting to prominent plugins when our own rules are reimplemented (since more projects have `B` activated than `RUF`). ## Test Plan `cargo test` # Conflicts: # crates/ruff_linter/src/rules/ruff/rules/mod.rs
## Summary At present, our versioning policy forbids the addition of safe fixes to stable rules outside of a minor release, so we've accumulated a bunch of new fixes that are behind `--preview`, and can be ungated in v0.2.0. To find these, I just grepped for `preview.is_enabled()` and identified all such cases. I then audited the `preview_rules` test fixtures and removed any tests that existed only to test this autofix behavior. # Conflicts: # crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM114_SIM114.py.snap # crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__preview__SIM114_SIM114.py.snap
## Summary Un-gates the behavior to allow `sys.path` modifications between imports, which removed a bunch of false positives in the ecosystem CI at the time.
## Summary Both of the preview behaviors gated here seem like improvements, so let's make them stable in v0.2.0
## Summary Un-gates detecting `dict.get` rewrites in `if` expressions (rather than just `if` statements).
…<full|concise>` (#9687) Fixes #7350 ## Summary * `--show-source` and `--no-show-source` are now deprecated. * `output-format` supports two new variants, `full` and `concise`. `text` is now a deprecated variant, and any use of it is treated as the default serialization format. * `--output-format` now default to `concise` * In preview mode, `--output-format` defaults to `full` * `--show-source` will still set `--output-format` to `full` if the output format is not otherwise specified. * likewise, `--no-show-source` can override an output format that was set in a file-based configuration, though it will also be overridden by `--output-format` ## Test Plan A lot of tests were updated to use `--output-format=full`. Additional tests were added to ensure the correct deprecation warnings appeared, and that deprecated options behaved as intended. # Conflicts: # crates/ruff/tests/integration_test.rs
Fixes a regression in the ecosystem checks from #9687 which was causing them to run for multiple hours due to the size of the output. We need the concise format for comparisons. We should probably update the ecosystem checks to actually diff the full output in the future because that'd be nice. # Conflicts: # python/ruff-ecosystem/ruff_ecosystem/projects.py
Adds a new `Deprecated` rule group in addition to `Stable` and `Preview`. Deprecated rules: - Warn on explicit selection without preview - Error on explicit selection with preview - Are excluded when selected by prefix with preview Deprecates `TRY200`, `ANN101`, and `ANN102` as a proof of concept. We can consider deprecating them separately.
Similar to #9689 — retains removed rules for better error messages and documentation but removed rules _cannot_ be used in any context. Removes PLR1706 as a useful test case and something we want to accomplish in #9680 anyway. The rule was in preview so we do not need to deprecate it first. Closes #9007 ## Test plan <img width="1110" alt="Rules table" src="https://github.com/astral-sh/ruff/assets/2586601/ac9fa682-623c-44aa-8e51-d8ab0d308355"> <img width="1110" alt="Rule page" src="https://github.com/astral-sh/ruff/assets/2586601/05850b2d-7ca5-49bb-8df8-bb931bab25cd">
## Summary This PR stabilizes the preview rules from: - `flake8-trio` (6 rules) - `flake8-quotes` (1 rule) - `pyupgrade` (1 rule) - `flake8-pyi` (1 rule) - `flake8-simplify` (2 rules) - `flake8-bandit` (9 rules; 14 remain in preview) - `flake8-type-checking` (1 rule) - `numpy` (1 rule) - `ruff` (4 rules, one elevated from nursery; 6 remain in preview as they were added within the last 30 days) - `flake8-logging` (4 rules) I see these are largely uncontroversial.
## Summary This rule was added to `flake8-type-checking` as `TC010`. We're about to stabilize it, so we might as well use the correct code. See: #9573.
Cherry-picked from #9714 which is being abandoned for now because we need to invest more into our redirection infrastructure before it is feasible. Fixes a bug in the implementation where we improperly included deprecated rules in `RuleSelector.rules()` when preview is on. Includes some clean-up of error messages and the implementation. # Conflicts: # crates/ruff/tests/integration_test.rs
Extends #9752 adding internal test rules for redirection Fixes a bug where we did not see warnings for exact codes that are redirected (just prefixes)
charliermarsh
approved these changes
Feb 1, 2024
zanieb
added a commit
that referenced
this pull request
Feb 1, 2024
Similar to #9689 — retains removed rules for better error messages and documentation but removed rules _cannot_ be used in any context. Removes PLR1706 as a useful test case and something we want to accomplish in #9680 anyway. The rule was in preview so we do not need to deprecate it first. Closes #9007 ## Test plan <img width="1110" alt="Rules table" src="https://github.com/astral-sh/ruff/assets/2586601/ac9fa682-623c-44aa-8e51-d8ab0d308355"> <img width="1110" alt="Rule page" src="https://github.com/astral-sh/ruff/assets/2586601/05850b2d-7ca5-49bb-8df8-bb931bab25cd">
Merged
zanieb
added a commit
that referenced
this pull request
Feb 1, 2024
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.
This is a tracking pull request for v0.2.0.
See the tracking issue and milestone for more details on planned work.
Note this pull request should be rebased and merged instead of squashed.
Changes
ANN101
, andANN102
PLR1706
TRY200
toB904
#9755PHG001
toS307
andPGH002
toG010
#9756lint.
settings over top-level settings #9476flake8-pyi
] Markunaliased-collections-abc-set-import
fix as safe #9679static-key-dict-comprehension
fromRUF011
toB035
#9428pycodestyle
rules #9685flake8-pie
rules #9684flake8-simplify
rules #9686--show-source
and--no-show-source
with--output_format=<full|concise>
#9687runtime-string-union
toTCH010
#9721Issues
Closes #7993
Closes #7993
Closes #7993
Closes #9007
Closes #8830
Closes #8736
Closes #8931
Closes #3758
Closes #7992
Closes #7710
Closes #7709