diff --git a/CHANGELOG.md b/CHANGELOG.md index 24ec92128f0f7..5e406e31c25f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # Changelog +## 0.5.1 + +### Preview features + +- \[`flake8-bugbear`\] Implement mutable-contextvar-default (B039) ([#12113](https://github.com/astral-sh/ruff/pull/12113)) +- \[`pycodestyle`\] Whitespace after decorator (`E204`) ([#12140](https://github.com/astral-sh/ruff/pull/12140)) +- \[`pytest`\] Reverse `PT001` and `PT0023` defaults ([#12106](https://github.com/astral-sh/ruff/pull/12106)) + +### Rule changes + +- Enable token-based rules on source with syntax errors ([#11950](https://github.com/astral-sh/ruff/pull/11950)) +- \[`flake8-bandit`\] Detect `httpx` for `S113` ([#12174](https://github.com/astral-sh/ruff/pull/12174)) +- \[`numpy`\] Update `NPY201` to include exception deprecations ([#12065](https://github.com/astral-sh/ruff/pull/12065)) +- \[`pylint`\] Generate autofix for `duplicate-bases` (`PLE0241`) ([#12105](https://github.com/astral-sh/ruff/pull/12105)) + +### Server + +- Avoid syntax error notification for source code actions ([#12148](https://github.com/astral-sh/ruff/pull/12148)) +- Consider the content of the new cells during notebook sync ([#12203](https://github.com/astral-sh/ruff/pull/12203)) +- Fix replacement edit range computation ([#12171](https://github.com/astral-sh/ruff/pull/12171)) + +### Bug fixes + +- Disable auto-fix when source has syntax errors ([#12134](https://github.com/astral-sh/ruff/pull/12134)) +- Fix cache key collisions for paths with separators ([#12159](https://github.com/astral-sh/ruff/pull/12159)) +- Make `requires-python` inference robust to `==` ([#12091](https://github.com/astral-sh/ruff/pull/12091)) +- Use char-wise width instead of `str`-width ([#12135](https://github.com/astral-sh/ruff/pull/12135)) +- \[`pycodestyle`\] Avoid `E275` if keyword followed by comma ([#12136](https://github.com/astral-sh/ruff/pull/12136)) +- \[`pycodestyle`\] Avoid `E275` if keyword is followed by a semicolon ([#12095](https://github.com/astral-sh/ruff/pull/12095)) +- \[`pylint`\] Skip [dummy variables](https://docs.astral.sh/ruff/settings/#lint_dummy-variable-rgx) for `PLR1704` ([#12190](https://github.com/astral-sh/ruff/pull/12190)) + +### Performance + +- Remove allocation in `parse_identifier` ([#12103](https://github.com/astral-sh/ruff/pull/12103)) +- Use `CompactString` for `Identifier` AST node ([#12101](https://github.com/astral-sh/ruff/pull/12101)) + ## 0.5.0 Check out the [blog post](https://astral.sh/blog/ruff-v0.5.0) for a migration guide and overview of the changes! diff --git a/Cargo.lock b/Cargo.lock index 464b8cde5d968..07e945a5164c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1995,7 +1995,7 @@ dependencies = [ [[package]] name = "ruff" -version = "0.5.0" +version = "0.5.1" dependencies = [ "anyhow", "argfile", @@ -2177,7 +2177,7 @@ dependencies = [ [[package]] name = "ruff_linter" -version = "0.5.0" +version = "0.5.1" dependencies = [ "aho-corasick", "annotate-snippets 0.9.2", diff --git a/README.md b/README.md index 0424761b92774..779490f2c6ad9 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.0/install.sh | sh -powershell -c "irm https://astral.sh/ruff/0.5.0/install.ps1 | iex" +curl -LsSf https://astral.sh/ruff/0.5.1/install.sh | sh +powershell -c "irm https://astral.sh/ruff/0.5.1/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.0 + rev: v0.5.1 hooks: # Run the linter. - id: ruff diff --git a/crates/ruff/Cargo.toml b/crates/ruff/Cargo.toml index 59d7ad11790ac..2a13d3d696815 100644 --- a/crates/ruff/Cargo.toml +++ b/crates/ruff/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruff" -version = "0.5.0" +version = "0.5.1" publish = true authors = { workspace = true } edition = { workspace = true } diff --git a/crates/ruff_linter/Cargo.toml b/crates/ruff_linter/Cargo.toml index 51c30774761e0..ab75f5a2becb1 100644 --- a/crates/ruff_linter/Cargo.toml +++ b/crates/ruff_linter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruff_linter" -version = "0.5.0" +version = "0.5.1" publish = false authors = { workspace = true } edition = { workspace = true } diff --git a/crates/ruff_linter/src/rules/pylint/rules/redefined_argument_from_local.rs b/crates/ruff_linter/src/rules/pylint/rules/redefined_argument_from_local.rs index 794a6518afa56..ce3be6512500a 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/redefined_argument_from_local.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/redefined_argument_from_local.rs @@ -22,6 +22,10 @@ use ruff_macros::{derive_message_formats, violation}; /// for inner_host_id, host in [[12.13, "Venus"], [14.15, "Mars"]]: /// print(host_id, inner_host_id, host) /// ``` +/// +/// ## Options +/// - `lint.dummy-variable-rgx` +/// /// ## References /// - [Pylint documentation](https://pylint.readthedocs.io/en/latest/user_guide/messages/refactor/redefined-argument-from-local.html) diff --git a/docs/integrations.md b/docs/integrations.md index a85a5a2288c57..9b7fdc91e8038 100644 --- a/docs/integrations.md +++ b/docs/integrations.md @@ -14,7 +14,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.0 + rev: v0.5.1 hooks: # Run the linter. - id: ruff @@ -27,7 +27,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.0 + rev: v0.5.1 hooks: # Run the linter. - id: ruff @@ -41,7 +41,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.0 + rev: v0.5.1 hooks: # Run the linter. - id: ruff diff --git a/pyproject.toml b/pyproject.toml index f1fa6efdd12b1..c6b567db0cece 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "ruff" -version = "0.5.0" +version = "0.5.1" 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 bc35b584e4c8a..a27ec0b73bfa5 100644 --- a/scripts/benchmarks/pyproject.toml +++ b/scripts/benchmarks/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "scripts" -version = "0.5.0" +version = "0.5.1" description = "" authors = ["Charles Marsh "]