diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e7f621738038..ccbe91404e54e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,52 @@ # Changelog +## 0.7.0 + +Check out the [blog post](https://astral.sh/blog/ruff-v0.7.0) for a migration guide and overview of the changes! + +### Breaking changes + +- The pytest rules `PT001` and `PT023` now default to omitting the decorator parentheses when there are no arguments + ([#12838](https://github.com/astral-sh/ruff/pull/12838), [#13292](https://github.com/astral-sh/ruff/pull/13292)). + This was a change that we attempted to make in Ruff v0.6.0, but only partially made due to an error on our part. + See the [blog post](https://astral.sh/blog/ruff-v0.7.0) for more details. +- The `useless-try-except` rule (in our `tryceratops` category) has been recoded from `TRY302` to + `TRY203` ([#13502](https://github.com/astral-sh/ruff/pull/13502)). This ensures Ruff's code is consistent with + the same rule in the [`tryceratops`](https://github.com/guilatrova/tryceratops) linter. +- The `lint.allow-unused-imports` setting has been removed ([#13677](https://github.com/astral-sh/ruff/pull/13677)). Use + [`lint.pyflakes.allow-unused-imports`](https://docs.astral.sh/ruff/settings/#lint_pyflakes_allowed-unused-imports) + instead. + +### Formatter preview style + +- Normalize implicit concatenated f-string quotes per part ([#13539](https://github.com/astral-sh/ruff/pull/13539)) + +### Preview linter features + +- \[`refurb`\] implement `hardcoded-string-charset` (FURB156) ([#13530](https://github.com/astral-sh/ruff/pull/13530)) +- \[`refurb`\] Count codepoints not bytes for `slice-to-remove-prefix-or-suffix (FURB188)` ([#13631](https://github.com/astral-sh/ruff/pull/13631)) + +### Rule changes + +- \[`pylint`\] Mark `PLE1141` fix as unsafe ([#13629](https://github.com/astral-sh/ruff/pull/13629)) +- \[`flake8-async`\] Consider async generators to be "checkpoints" for `cancel-scope-no-checkpoint` (`ASYNC100`) ([#13639](https://github.com/astral-sh/ruff/pull/13639)) +- \[`flake8-bugbear`\] Do not suggest setting parameter `strict=` to `False` in `B905` diagnostic message ([#13656](https://github.com/astral-sh/ruff/pull/13656)) +- \[`flake8-todos`\] Only flag the word "TODO", not words starting with "todo" (`TD006`) ([#13640](https://github.com/astral-sh/ruff/pull/13640)) +- \[`pycodestyle`\] Fix whitespace-related false positives and false negatives inside type-parameter lists (`E231`, `E251`) ([#13704](https://github.com/astral-sh/ruff/pull/13704)) +- \[`flake8-simplify`\] Stabilize preview behavior for `SIM115` so that the rule can detect files + being opened from a wider range of standard-library functions ([#12959](https://github.com/astral-sh/ruff/pull/12959)). + +### CLI + +- Add explanation of fixable in `--statistics` command ([#13774](https://github.com/astral-sh/ruff/pull/13774)) + +### Bug fixes + +- \[`pyflakes`\] Allow `ipytest` cell magic (`F401`) ([#13745](https://github.com/astral-sh/ruff/pull/13745)) +- \[`flake8-use-pathlib`\] Fix `PTH123` false positive when `open` is passed a file descriptor ([#13616](https://github.com/astral-sh/ruff/pull/13616)) +- \[`flake8-bandit`\] Detect patterns from multi line SQL statements (`S608`) ([#13574](https://github.com/astral-sh/ruff/pull/13574)) +- \[`flake8-pyi`\] - Fix dropped expressions in `PYI030` autofix ([#13727](https://github.com/astral-sh/ruff/pull/13727)) + ## 0.6.9 ### Preview features diff --git a/Cargo.lock b/Cargo.lock index ce8524b873783..9fd3cb9b621df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2320,7 +2320,7 @@ dependencies = [ [[package]] name = "ruff" -version = "0.6.9" +version = "0.7.0" dependencies = [ "anyhow", "argfile", @@ -2539,7 +2539,7 @@ dependencies = [ [[package]] name = "ruff_linter" -version = "0.6.9" +version = "0.7.0" dependencies = [ "aho-corasick", "annotate-snippets 0.9.2", @@ -2859,7 +2859,7 @@ dependencies = [ [[package]] name = "ruff_wasm" -version = "0.6.9" +version = "0.7.0" dependencies = [ "console_error_panic_hook", "console_log", diff --git a/README.md b/README.md index d5ee610ca391e..778dc1ce7e06f 100644 --- a/README.md +++ b/README.md @@ -136,8 +136,8 @@ curl -LsSf https://astral.sh/ruff/install.sh | sh powershell -c "irm https://astral.sh/ruff/install.ps1 | iex" # For a specific version. -curl -LsSf https://astral.sh/ruff/0.6.9/install.sh | sh -powershell -c "irm https://astral.sh/ruff/0.6.9/install.ps1 | iex" +curl -LsSf https://astral.sh/ruff/0.7.0/install.sh | sh +powershell -c "irm https://astral.sh/ruff/0.7.0/install.ps1 | iex" ``` You can also install Ruff via [Homebrew](https://formulae.brew.sh/formula/ruff), [Conda](https://anaconda.org/conda-forge/ruff), @@ -170,7 +170,7 @@ Ruff can also be used as a [pre-commit](https://pre-commit.com/) hook via [`ruff ```yaml - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.6.9 + rev: v0.7.0 hooks: # Run the linter. - id: ruff diff --git a/crates/ruff/Cargo.toml b/crates/ruff/Cargo.toml index d6889a3c13bfa..40dcddbf8a2be 100644 --- a/crates/ruff/Cargo.toml +++ b/crates/ruff/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruff" -version = "0.6.9" +version = "0.7.0" publish = true authors = { workspace = true } edition = { workspace = true } diff --git a/crates/ruff_linter/Cargo.toml b/crates/ruff_linter/Cargo.toml index a795dd30d1ac1..eded5f03f457d 100644 --- a/crates/ruff_linter/Cargo.toml +++ b/crates/ruff_linter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruff_linter" -version = "0.6.9" +version = "0.7.0" publish = false authors = { workspace = true } edition = { workspace = true } diff --git a/crates/ruff_wasm/Cargo.toml b/crates/ruff_wasm/Cargo.toml index fa94e2bb198c3..065a997681025 100644 --- a/crates/ruff_wasm/Cargo.toml +++ b/crates/ruff_wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruff_wasm" -version = "0.6.9" +version = "0.7.0" publish = false authors = { workspace = true } edition = { workspace = true } diff --git a/docs/integrations.md b/docs/integrations.md index d39a3114eb721..973fba10364e2 100644 --- a/docs/integrations.md +++ b/docs/integrations.md @@ -78,7 +78,7 @@ Ruff can be used as a [pre-commit](https://pre-commit.com) hook via [`ruff-pre-c ```yaml - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.6.9 + rev: v0.7.0 hooks: # Run the linter. - id: ruff @@ -91,7 +91,7 @@ To enable lint fixes, add the `--fix` argument to the lint hook: ```yaml - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.6.9 + rev: v0.7.0 hooks: # Run the linter. - id: ruff @@ -105,7 +105,7 @@ To run the hooks over Jupyter Notebooks too, add `jupyter` to the list of allowe ```yaml - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.6.9 + rev: v0.7.0 hooks: # Run the linter. - id: ruff diff --git a/pyproject.toml b/pyproject.toml index 3cb16e139de03..90cd6fe2fd23a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "ruff" -version = "0.6.9" +version = "0.7.0" description = "An extremely fast Python linter and code formatter, written in Rust." authors = [{ name = "Astral Software Inc.", email = "hey@astral.sh" }] readme = "README.md" diff --git a/scripts/benchmarks/pyproject.toml b/scripts/benchmarks/pyproject.toml index 4f392d074fdcc..e796fec03b750 100644 --- a/scripts/benchmarks/pyproject.toml +++ b/scripts/benchmarks/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "scripts" -version = "0.6.9" +version = "0.7.0" description = "" authors = ["Charles Marsh "]