Skip to content

Commit b261203

Browse files
committed
Merge remote-tracking branch 'origin/main' into dcreager/dynamic-bounds
* origin/main: Remove duplicate preview tests for `FURB101` and `FURB103` (#21303) [ty] Add support for `Literal`s in implicit type aliases (#21296) [ty] Add missing `heap_size` to `variance_of` queries (#21318) [`pyupgrade`] Fix false positive on relative imports from local `.builtins` module (`UP029`) (#21309) [ty] Make range/position conversions fallible (#21297) Bump 0.14.4 (#21306) Fix main by using `infer_expression` (#21299) [ty] Understand legacy and PEP 695 `ParamSpec` (#21139) [ty] Discover site-packages from the environment that ty is installed in (#21286) [ty] Make special cases for `UnionType` slightly narrower (#21276) Require ignore 0.4.24 in `Cargo.toml` (#21292) [ty] Favour imported symbols over builtin symbols (#21285) docs: revise Ruff setup instructions for Zed editor (#20935) [ty] Update salsa (#21281) [syntax-error]: no binding for nonlocal PLE0117 as a semantic syntax error (#21032)
2 parents fc22207 + 276f1d0 commit b261203

File tree

78 files changed

+2190
-1158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2190
-1158
lines changed

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
11
# Changelog
22

3+
## 0.14.4
4+
5+
Released on 2025-11-06.
6+
7+
### Preview features
8+
9+
- [formatter] Allow newlines after function headers without docstrings ([#21110](https://github.com/astral-sh/ruff/pull/21110))
10+
- [formatter] Avoid extra parentheses for long `match` patterns with `as` captures ([#21176](https://github.com/astral-sh/ruff/pull/21176))
11+
- \[`refurb`\] Expand fix safety for keyword arguments and `Decimal`s (`FURB164`) ([#21259](https://github.com/astral-sh/ruff/pull/21259))
12+
- \[`refurb`\] Preserve argument ordering in autofix (`FURB103`) ([#20790](https://github.com/astral-sh/ruff/pull/20790))
13+
14+
### Bug fixes
15+
16+
- [server] Fix missing diagnostics for notebooks ([#21156](https://github.com/astral-sh/ruff/pull/21156))
17+
- \[`flake8-bugbear`\] Ignore non-NFKC attribute names in `B009` and `B010` ([#21131](https://github.com/astral-sh/ruff/pull/21131))
18+
- \[`refurb`\] Fix false negative for underscores before sign in `Decimal` constructor (`FURB157`) ([#21190](https://github.com/astral-sh/ruff/pull/21190))
19+
- \[`ruff`\] Fix false positives on starred arguments (`RUF057`) ([#21256](https://github.com/astral-sh/ruff/pull/21256))
20+
21+
### Rule changes
22+
23+
- \[`airflow`\] extend deprecated argument `concurrency` in `airflow..DAG` (`AIR301`) ([#21220](https://github.com/astral-sh/ruff/pull/21220))
24+
25+
### Documentation
26+
27+
- Improve `extend` docs ([#21135](https://github.com/astral-sh/ruff/pull/21135))
28+
- \[`flake8-comprehensions`\] Fix typo in `C416` documentation ([#21184](https://github.com/astral-sh/ruff/pull/21184))
29+
- Revise Ruff setup instructions for Zed editor ([#20935](https://github.com/astral-sh/ruff/pull/20935))
30+
31+
### Other changes
32+
33+
- Make `ruff analyze graph` work with jupyter notebooks ([#21161](https://github.com/astral-sh/ruff/pull/21161))
34+
35+
### Contributors
36+
37+
- [@chirizxc](https://github.com/chirizxc)
38+
- [@Lee-W](https://github.com/Lee-W)
39+
- [@musicinmybrain](https://github.com/musicinmybrain)
40+
- [@MichaReiser](https://github.com/MichaReiser)
41+
- [@tjkuson](https://github.com/tjkuson)
42+
- [@danparizher](https://github.com/danparizher)
43+
- [@renovate](https://github.com/renovate)
44+
- [@ntBre](https://github.com/ntBre)
45+
- [@gauthsvenkat](https://github.com/gauthsvenkat)
46+
- [@LoicRiegel](https://github.com/LoicRiegel)
47+
348
## 0.14.3
449

550
Released on 2025-10-30.

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ hashbrown = { version = "0.16.0", default-features = false, features = [
103103
"inline-more",
104104
] }
105105
heck = "0.5.0"
106-
ignore = { version = "0.4.22" }
106+
ignore = { version = "0.4.24" }
107107
imara-diff = { version = "0.1.5" }
108108
imperative = { version = "1.0.4" }
109109
indexmap = { version = "2.6.0" }
@@ -146,7 +146,7 @@ regex-automata = { version = "0.4.9" }
146146
rustc-hash = { version = "2.0.0" }
147147
rustc-stable-hash = { version = "0.1.2" }
148148
# When updating salsa, make sure to also update the revision in `fuzz/Cargo.toml`
149-
salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "664750a6e588ed23a0d2d9105a02cb5993c8e178", default-features = false, features = [
149+
salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "05a9af7f554b64b8aadc2eeb6f2caf73d0408d09", default-features = false, features = [
150150
"compact_str",
151151
"macros",
152152
"salsa_unstable",

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ curl -LsSf https://astral.sh/ruff/install.sh | sh
147147
powershell -c "irm https://astral.sh/ruff/install.ps1 | iex"
148148

149149
# For a specific version.
150-
curl -LsSf https://astral.sh/ruff/0.14.3/install.sh | sh
151-
powershell -c "irm https://astral.sh/ruff/0.14.3/install.ps1 | iex"
150+
curl -LsSf https://astral.sh/ruff/0.14.4/install.sh | sh
151+
powershell -c "irm https://astral.sh/ruff/0.14.4/install.ps1 | iex"
152152
```
153153

154154
You can also install Ruff via [Homebrew](https://formulae.brew.sh/formula/ruff), [Conda](https://anaconda.org/conda-forge/ruff),
@@ -181,7 +181,7 @@ Ruff can also be used as a [pre-commit](https://pre-commit.com/) hook via [`ruff
181181
```yaml
182182
- repo: https://github.com/astral-sh/ruff-pre-commit
183183
# Ruff version.
184-
rev: v0.14.3
184+
rev: v0.14.4
185185
hooks:
186186
# Run the linter.
187187
- id: ruff-check

crates/ruff/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ruff"
3-
version = "0.14.3"
3+
version = "0.14.4"
44
publish = true
55
authors = { workspace = true }
66
edition = { workspace = true }

crates/ruff_linter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ruff_linter"
3-
version = "0.14.3"
3+
version = "0.14.4"
44
publish = false
55
authors = { workspace = true }
66
edition = { workspace = true }
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .builtins import next
2+
from ..builtins import str
3+
from ...builtins import int
4+
from .builtins import next as _next
5+

crates/ruff_linter/src/checkers/ast/analyze/statement.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ pub(crate) fn statement(stmt: &Stmt, checker: &mut Checker) {
4343
pycodestyle::rules::ambiguous_variable_name(checker, name, name.range());
4444
}
4545
}
46-
if checker.is_rule_enabled(Rule::NonlocalWithoutBinding) {
47-
pylint::rules::nonlocal_without_binding(checker, nonlocal);
48-
}
4946
if checker.is_rule_enabled(Rule::NonlocalAndGlobal) {
5047
pylint::rules::nonlocal_and_global(checker, nonlocal);
5148
}
@@ -720,7 +717,9 @@ pub(crate) fn statement(stmt: &Stmt, checker: &mut Checker) {
720717
}
721718
if checker.is_rule_enabled(Rule::UnnecessaryBuiltinImport) {
722719
if let Some(module) = module {
723-
pyupgrade::rules::unnecessary_builtin_import(checker, stmt, module, names);
720+
pyupgrade::rules::unnecessary_builtin_import(
721+
checker, stmt, module, names, level,
722+
);
724723
}
725724
}
726725
if checker.any_rule_enabled(&[

crates/ruff_linter/src/checkers/ast/mod.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ use crate::rules::pyflakes::rules::{
7373
UndefinedLocalWithNestedImportStarUsage, YieldOutsideFunction,
7474
};
7575
use crate::rules::pylint::rules::{
76-
AwaitOutsideAsync, LoadBeforeGlobalDeclaration, YieldFromInAsyncFunction,
76+
AwaitOutsideAsync, LoadBeforeGlobalDeclaration, NonlocalWithoutBinding,
77+
YieldFromInAsyncFunction,
7778
};
7879
use crate::rules::{flake8_pyi, flake8_type_checking, pyflakes, pyupgrade};
7980
use crate::settings::rule_table::RuleTable;
@@ -641,6 +642,10 @@ impl SemanticSyntaxContext for Checker<'_> {
641642
self.semantic.global(name)
642643
}
643644

645+
fn has_nonlocal_binding(&self, name: &str) -> bool {
646+
self.semantic.nonlocal(name).is_some()
647+
}
648+
644649
fn report_semantic_error(&self, error: SemanticSyntaxError) {
645650
match error.kind {
646651
SemanticSyntaxErrorKind::LateFutureImport => {
@@ -717,6 +722,12 @@ impl SemanticSyntaxContext for Checker<'_> {
717722
self.report_diagnostic(pyflakes::rules::ContinueOutsideLoop, error.range);
718723
}
719724
}
725+
SemanticSyntaxErrorKind::NonlocalWithoutBinding(name) => {
726+
// PLE0117
727+
if self.is_rule_enabled(Rule::NonlocalWithoutBinding) {
728+
self.report_diagnostic(NonlocalWithoutBinding { name }, error.range);
729+
}
730+
}
720731
SemanticSyntaxErrorKind::ReboundComprehensionVariable
721732
| SemanticSyntaxErrorKind::DuplicateTypeParameter
722733
| SemanticSyntaxErrorKind::MultipleCaseAssignment(_)

crates/ruff_linter/src/preview.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -261,16 +261,6 @@ pub(crate) const fn is_b006_unsafe_fix_preserve_assignment_expr_enabled(
261261
settings.preview.is_enabled()
262262
}
263263

264-
// https://github.com/astral-sh/ruff/pull/20520
265-
pub(crate) const fn is_fix_read_whole_file_enabled(settings: &LinterSettings) -> bool {
266-
settings.preview.is_enabled()
267-
}
268-
269-
// https://github.com/astral-sh/ruff/pull/20520
270-
pub(crate) const fn is_fix_write_whole_file_enabled(settings: &LinterSettings) -> bool {
271-
settings.preview.is_enabled()
272-
}
273-
274264
pub(crate) const fn is_typing_extensions_str_alias_enabled(settings: &LinterSettings) -> bool {
275265
settings.preview.is_enabled()
276266
}

0 commit comments

Comments
 (0)