From afa25224c05335a15394f66738e3f93df13bb526 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Wed, 5 Jun 2024 20:10:14 +0530 Subject: [PATCH 1/3] Bump version to v0.4.8 --- CHANGELOG.md | 34 +++++++++++++++++++++++++++++++ Cargo.lock | 4 ++-- README.md | 2 +- crates/ruff/Cargo.toml | 2 +- crates/ruff_linter/Cargo.toml | 2 +- docs/integrations.md | 6 +++--- pyproject.toml | 2 +- scripts/benchmarks/pyproject.toml | 2 +- 8 files changed, 44 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 500a5ed511d37..3c598b5bddd6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,39 @@ # Changelog +## 0.4.8 + +### Performance + +- Maintain synchronicity between the lexer and the parser ([#11457](https://github.com/astral-sh/ruff/pull/11457)) + +### Preview features + +- \[`flake8-bugbear`\] Implement `return-in-generator` (`B901`) ([#11644](https://github.com/astral-sh/ruff/pull/11644)) +- \[`flake8-pyi`\] Implement `PYI063` ([#11699](https://github.com/astral-sh/ruff/pull/11699)) +- \[`pygrep_hooks`\] Check blanket ignores via file-level pragmas (`PGH004`) ([#11540](https://github.com/astral-sh/ruff/pull/11540)) + +### Rule changes + +- \[`pyupgrade`\] Update `UP035` for Python 3.13 and the latest version of `typing_extensions` ([#11693](https://github.com/astral-sh/ruff/pull/11693)) +- \[`numpy`\] Update `NPY001` rule for NumPy 2.0 ([#11735](https://github.com/astral-sh/ruff/pull/11735)) + +### Server + +- Formatting a document with syntax problems no longer spams a visible error popup ([#11745](https://github.com/astral-sh/ruff/pull/11745)) + +### CLI + +- Add RDJson support for `--output-format` flag ([#11682](https://github.com/astral-sh/ruff/pull/11682)) + +### Bug fixes + +- \[`pyupgrade`\] Write empty string in lieu of panic ([#11696](https://github.com/astral-sh/ruff/pull/11696)) +- \[`flake8-simplify`\] Simplify double negatives in `SIM103` ([#11684](https://github.com/astral-sh/ruff/pull/11684)) +- Generator should add a newline before type statement ([#11720](https://github.com/astral-sh/ruff/pull/11720)) +- Lexer should consider BOM for the start offset ([#11732](https://github.com/astral-sh/ruff/pull/11732)) +- Respect per-file ignores for blanket and redirected noqa rules ([#11728](https://github.com/astral-sh/ruff/pull/11728)) +- Use `Tokens` from parsed type annotation or parsed source ([#11740](https://github.com/astral-sh/ruff/pull/11740)) + ## 0.4.7 ### Preview features diff --git a/Cargo.lock b/Cargo.lock index 0654eab5f9960..162ca379af1a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1896,7 +1896,7 @@ dependencies = [ [[package]] name = "ruff" -version = "0.4.7" +version = "0.4.8" dependencies = [ "anyhow", "argfile", @@ -2057,7 +2057,7 @@ dependencies = [ [[package]] name = "ruff_linter" -version = "0.4.7" +version = "0.4.8" dependencies = [ "aho-corasick", "annotate-snippets 0.9.2", diff --git a/README.md b/README.md index 805f518942f3c..010f56bb5a56e 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,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.4.7 + rev: v0.4.8 hooks: # Run the linter. - id: ruff diff --git a/crates/ruff/Cargo.toml b/crates/ruff/Cargo.toml index e069a649a8b0a..ce24a1cee33fb 100644 --- a/crates/ruff/Cargo.toml +++ b/crates/ruff/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruff" -version = "0.4.7" +version = "0.4.8" publish = false authors = { workspace = true } edition = { workspace = true } diff --git a/crates/ruff_linter/Cargo.toml b/crates/ruff_linter/Cargo.toml index 2f86b98b32536..6a9e6931df568 100644 --- a/crates/ruff_linter/Cargo.toml +++ b/crates/ruff_linter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruff_linter" -version = "0.4.7" +version = "0.4.8" publish = false authors = { workspace = true } edition = { workspace = true } diff --git a/docs/integrations.md b/docs/integrations.md index 8fe2cec74dd66..ea539cdaa450f 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.4.7 + rev: v0.4.8 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.4.7 + rev: v0.4.8 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.4.7 + rev: v0.4.8 hooks: # Run the linter. - id: ruff diff --git a/pyproject.toml b/pyproject.toml index bc5d4a99bc763..4a4104ba34374 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "ruff" -version = "0.4.7" +version = "0.4.8" 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 a3f8ad834bf42..b1bc61caedcbc 100644 --- a/scripts/benchmarks/pyproject.toml +++ b/scripts/benchmarks/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "scripts" -version = "0.4.7" +version = "0.4.8" description = "" authors = ["Charles Marsh "] From f4a76e85d3e0811352916e01d379cb1cbd821840 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Wed, 5 Jun 2024 20:38:12 +0530 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Alex Waygood --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c598b5bddd6c..ed70693934d77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,9 +27,9 @@ ### Bug fixes -- \[`pyupgrade`\] Write empty string in lieu of panic ([#11696](https://github.com/astral-sh/ruff/pull/11696)) +- \[`pyupgrade`\] Write empty string in lieu of panic when fixing `UP032` ([#11696](https://github.com/astral-sh/ruff/pull/11696)) - \[`flake8-simplify`\] Simplify double negatives in `SIM103` ([#11684](https://github.com/astral-sh/ruff/pull/11684)) -- Generator should add a newline before type statement ([#11720](https://github.com/astral-sh/ruff/pull/11720)) +- Ensure the expression generator adds a newline before ``type`` statements ([#11720](https://github.com/astral-sh/ruff/pull/11720)) - Lexer should consider BOM for the start offset ([#11732](https://github.com/astral-sh/ruff/pull/11732)) - Respect per-file ignores for blanket and redirected noqa rules ([#11728](https://github.com/astral-sh/ruff/pull/11728)) - Use `Tokens` from parsed type annotation or parsed source ([#11740](https://github.com/astral-sh/ruff/pull/11740)) From 8579ed153d226061f22890a1deecfd0951270ffe Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Wed, 5 Jun 2024 20:41:43 +0530 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed70693934d77..fecf38a71eee0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Performance -- Maintain synchronicity between the lexer and the parser ([#11457](https://github.com/astral-sh/ruff/pull/11457)) +- Linter performance has been improved by around 10% on some microbenchmarks by refactoring the lexer and parser to maintain synchronicity between them ([#11457](https://github.com/astral-sh/ruff/pull/11457)) ### Preview features @@ -29,10 +29,8 @@ - \[`pyupgrade`\] Write empty string in lieu of panic when fixing `UP032` ([#11696](https://github.com/astral-sh/ruff/pull/11696)) - \[`flake8-simplify`\] Simplify double negatives in `SIM103` ([#11684](https://github.com/astral-sh/ruff/pull/11684)) -- Ensure the expression generator adds a newline before ``type`` statements ([#11720](https://github.com/astral-sh/ruff/pull/11720)) -- Lexer should consider BOM for the start offset ([#11732](https://github.com/astral-sh/ruff/pull/11732)) +- Ensure the expression generator adds a newline before `type` statements ([#11720](https://github.com/astral-sh/ruff/pull/11720)) - Respect per-file ignores for blanket and redirected noqa rules ([#11728](https://github.com/astral-sh/ruff/pull/11728)) -- Use `Tokens` from parsed type annotation or parsed source ([#11740](https://github.com/astral-sh/ruff/pull/11740)) ## 0.4.7