diff --git a/CHANGELOG.md b/CHANGELOG.md index 731a820453b10d..f4c954dc278543 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,43 @@ # Changelog +## 0.5.7 + +### Preview features + +- [`flake8-comprehensions`] Account for list and set comprehensions in `unnecessary-literal-within-tuple-call` (`C409`) ([#12657](https://github.com/astral-sh/ruff/pull/12657)) +- [`flake8-pyi`] Add autofix for `future-annotations-in-stub` (`PYI044`) ([#12676](https://github.com/astral-sh/ruff/pull/12676)) +- [`flake8-return`] Avoid syntax error when auto-fixing `RET505` with mixed indentation (space and tabs) ([#12740](https://github.com/astral-sh/ruff/pull/12740)) +- [`pydoclint`] Add `docstring-missing-yields` (`DOC402`) and `docstring-extraneous-yields` (`DOC403`) ([#12538](https://github.com/astral-sh/ruff/pull/12538)) +- [`pydoclint`] Avoid `DOC201` if docstring begins with "Return", "Returns", "Yield", or "Yields" ([#12675](https://github.com/astral-sh/ruff/pull/12675)) +- [`pydoclint`] Deduplicate collected exceptions after traversing function bodies (`DOC501`) ([#12642](https://github.com/astral-sh/ruff/pull/12642)) +- [`pydoclint`] Ignore `DOC` errors for stub functions ([#12651](https://github.com/astral-sh/ruff/pull/12651)) +- [`pydoclint`] Teach rules to understand reraised exceptions as being explicitly raised (`DOC501`, `DOC502`) ([#12639](https://github.com/astral-sh/ruff/pull/12639)) +- [`ruff`] Implement `incorrectly-parenthesized-tuple-in-subscript` (`RUF031`) ([#12480](https://github.com/astral-sh/ruff/pull/12480)) +- [`ruff`] Mark `RUF023` fix as unsafe if `__slots__` is not a set and the binding is used elsewhere ([#12692](https://github.com/astral-sh/ruff/pull/12692)) + +### Rule changes + +- [`refurb`] Add autofix for `implicit-cwd` (`FURB177`) ([#12708](https://github.com/astral-sh/ruff/pull/12708)) +- [`ruff`] Add autofix for `zip-instead-of-pairwise` (`RUF007`) ([#12663](https://github.com/astral-sh/ruff/pull/12663)) +- [`tryceratops`] Add `BaseException` to `raise-vanilla-class` rule (`TRY002`) ([#12620](https://github.com/astral-sh/ruff/pull/12620)) + +### Server + +- Ignore non-file workspace URL; Ruff will display a warning notification in this case ([#12725](https://github.com/astral-sh/ruff/pull/12725)) + +### CLI + +- Fix cache invalidation for nested `pyproject.toml` files ([#12727](https://github.com/astral-sh/ruff/pull/12727)) + +### Bug fixes + +- [`flake8-async`] Fix false positives with multiple `async with` items (`ASYNC100`) ([#12643](https://github.com/astral-sh/ruff/pull/12643)) +- [`flake8-bandit`] Avoid false-positives for list concatenations in SQL construction (`S608`) ([#12720](https://github.com/astral-sh/ruff/pull/12720)) +- [`flake8-bugbear`] Treat `return` as equivalent to `break` (`B909`) ([#12646](https://github.com/astral-sh/ruff/pull/12646)) +- [`flake8-comprehensions`] Set comprehensions not a violation for `sum` in `unnecessary-comprehension-in-call` (`C419`) ([#12691](https://github.com/astral-sh/ruff/pull/12691)) +- [`flake8-simplify`] Parenthesize conditions based on precedence when merging if arms (`SIM114`) ([#12737](https://github.com/astral-sh/ruff/pull/12737)) +- [`pydoclint`] Try both 'Raises' section styles when convention is unspecified (`DOC501`) ([#12649](https://github.com/astral-sh/ruff/pull/12649)) + ## 0.5.6 Ruff 0.5.6 automatically enables linting and formatting of notebooks in *preview mode*. @@ -2135,9 +2173,9 @@ Read Ruff's new [versioning policy](https://docs.astral.sh/ruff/versioning/). - Unsafe fixes are no longer displayed or applied without opt-in ([#7769](https://github.com/astral-sh/ruff/pull/7769)) - Drop formatting specific rules from the default set ([#7900](https://github.com/astral-sh/ruff/pull/7900)) - The deprecated `format` setting has been removed ([#7984](https://github.com/astral-sh/ruff/pull/7984)) - - The `format` setting cannot be used to configure the output format, use `output-format` instead - - The `RUFF_FORMAT` environment variable is ignored, use `RUFF_OUTPUT_FORMAT` instead - - The `--format` option has been removed from `ruff check`, use `--output-format` instead + - The `format` setting cannot be used to configure the output format, use `output-format` instead + - The `RUFF_FORMAT` environment variable is ignored, use `RUFF_OUTPUT_FORMAT` instead + - The `--format` option has been removed from `ruff check`, use `--output-format` instead ### Rule changes diff --git a/Cargo.lock b/Cargo.lock index 49ce5351e67ee4..c39b2a534b6d33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2046,7 +2046,7 @@ dependencies = [ [[package]] name = "ruff" -version = "0.5.6" +version = "0.5.7" dependencies = [ "anyhow", "argfile", @@ -2234,7 +2234,7 @@ dependencies = [ [[package]] name = "ruff_linter" -version = "0.5.6" +version = "0.5.7" dependencies = [ "aho-corasick", "annotate-snippets 0.9.2", @@ -2554,7 +2554,7 @@ dependencies = [ [[package]] name = "ruff_wasm" -version = "0.5.6" +version = "0.5.7" dependencies = [ "console_error_panic_hook", "console_log", diff --git a/README.md b/README.md index add707b3d51550..2b39a34ea26fda 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.5.6/install.sh | sh -powershell -c "irm https://astral.sh/ruff/0.5.6/install.ps1 | iex" +curl -LsSf https://astral.sh/ruff/0.5.7/install.sh | sh +powershell -c "irm https://astral.sh/ruff/0.5.7/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.5.6 + rev: v0.5.7 hooks: # Run the linter. - id: ruff diff --git a/crates/ruff/Cargo.toml b/crates/ruff/Cargo.toml index 83c3ead1392e07..8535d18fa9143c 100644 --- a/crates/ruff/Cargo.toml +++ b/crates/ruff/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruff" -version = "0.5.6" +version = "0.5.7" publish = true authors = { workspace = true } edition = { workspace = true } diff --git a/crates/ruff_linter/Cargo.toml b/crates/ruff_linter/Cargo.toml index d838cf9f8dceb9..14a7ac96243d9d 100644 --- a/crates/ruff_linter/Cargo.toml +++ b/crates/ruff_linter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruff_linter" -version = "0.5.6" +version = "0.5.7" publish = false authors = { workspace = true } edition = { workspace = true } diff --git a/crates/ruff_wasm/Cargo.toml b/crates/ruff_wasm/Cargo.toml index f18f3f831c5bd0..ab7e073f88649d 100644 --- a/crates/ruff_wasm/Cargo.toml +++ b/crates/ruff_wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruff_wasm" -version = "0.5.6" +version = "0.5.7" publish = false authors = { workspace = true } edition = { workspace = true } diff --git a/docs/integrations.md b/docs/integrations.md index dc86c661388997..ca9fb8cefa5994 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.5.6 + rev: v0.5.7 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.5.6 + rev: v0.5.7 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.5.6 + rev: v0.5.7 hooks: # Run the linter. - id: ruff diff --git a/pyproject.toml b/pyproject.toml index 0077da1cb66e88..44eb139c02be13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "ruff" -version = "0.5.6" +version = "0.5.7" 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 827244f699b97d..dcb61c9ad03d01 100644 --- a/scripts/benchmarks/pyproject.toml +++ b/scripts/benchmarks/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "scripts" -version = "0.5.6" +version = "0.5.7" description = "" authors = ["Charles Marsh "]