Skip to content

Commit f83a5a3

Browse files
committed
Merge remote-tracking branch 'origin/main' into dcreager/deep-comparison
* origin/main: (59 commits) [ty] Improve diagnostic range for `non-subscriptable` diagnostics (#21461) [ty] Improve literal promotion heuristics (#21439) [ty] Further improve details around which expressions should be deferred in stub files (#21456) [ty] Improve generic class constructor inference (#21442) [ty] Propagate type context through conditional expressions (#21443) [ty] Suppress completions when introducing names with `as` [ty] Add panic-by-default await methods to `TestServer` (#21451) [ty] name is parameter and global is a syntax error (#21312) [ty] Fixup a few details around version-specific dataclass features (#21453) [ty] Support attribute-expression `TYPE_CHECKING` conditionals (#21449) [ty] Support stringified annotations in value-position `Annotated` instances (#21447) [ty] Type inference for genererator expressions (#21437) [ty] Make `__getattr__` available for `ModuleType` instances (#21450) [ty] Increase default receive timeout in tests to 10s (#21448) [ty] Add synthetic members to completions on dataclasses (#21446) [ty] Support legacy `typing` special forms in implicit type aliases (#21433) Bump 0.14.5 (#21435) [ty] Support `type[…]` and `Type[…]` in implicit type aliases (#21421) [ty] Respect notebook cell boundaries when adding an auto import (#21322) Update PyCharm setup instructions (#21409) ...
2 parents bb68297 + d63b4b0 commit f83a5a3

File tree

195 files changed

+9690
-2495
lines changed

Some content is hidden

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

195 files changed

+9690
-2495
lines changed

.config/nextest.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ serial = { max-threads = 1 }
77
filter = 'binary(file_watching)'
88
test-group = 'serial'
99

10+
[[profile.default.overrides]]
11+
filter = 'binary(e2e)'
12+
test-group = 'serial'
13+
1014
[profile.ci]
1115
# Print out output for failing tests as soon as they fail, and also at the end
1216
# of the run (for easy scrollability).

.github/workflows/ci.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,16 +322,14 @@ jobs:
322322
uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2.62.49
323323
with:
324324
tool: cargo-nextest
325-
- name: "Install cargo insta"
326-
uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2.62.49
327-
with:
328-
tool: cargo-insta
329325
- name: "Install uv"
330326
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
331327
with:
332328
enable-cache: "true"
333329
- name: "Run tests"
334-
run: cargo insta test --release --all-features --unreferenced reject --test-runner nextest
330+
run: cargo nextest run --cargo-profile profiling --all-features
331+
- name: "Run doctests"
332+
run: cargo test --doc --profile profiling --all-features
335333

336334
cargo-test-other:
337335
strategy:

.github/workflows/ty-ecosystem-analyzer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
6868
cd ..
6969
70-
uv tool install "git+https://github.com/astral-sh/ecosystem-analyzer@908758da02a73ef3f3308e1dbb2248510029bbe4"
70+
uv tool install "git+https://github.com/astral-sh/ecosystem-analyzer@11aa5472cf9d6b9e019c401505a093112942d7bf"
7171
7272
ecosystem-analyzer \
7373
--repository ruff \

.github/workflows/ty-ecosystem-report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
5353
cd ..
5454
55-
uv tool install "git+https://github.com/astral-sh/ecosystem-analyzer@908758da02a73ef3f3308e1dbb2248510029bbe4"
55+
uv tool install "git+https://github.com/astral-sh/ecosystem-analyzer@11aa5472cf9d6b9e019c401505a093112942d7bf"
5656
5757
ecosystem-analyzer \
5858
--verbose \

CHANGELOG.md

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

3+
## 0.14.5
4+
5+
Released on 2025-11-13.
6+
7+
### Preview features
8+
9+
- \[`flake8-simplify`\] Apply `SIM113` when index variable is of type `int` ([#21395](https://github.com/astral-sh/ruff/pull/21395))
10+
- \[`pydoclint`\] Fix false positive when Sphinx directives follow a "Raises" section (`DOC502`) ([#20535](https://github.com/astral-sh/ruff/pull/20535))
11+
- \[`pydoclint`\] Support NumPy-style comma-separated parameters (`DOC102`) ([#20972](https://github.com/astral-sh/ruff/pull/20972))
12+
- \[`refurb`\] Auto-fix annotated assignments (`FURB101`) ([#21278](https://github.com/astral-sh/ruff/pull/21278))
13+
- \[`ruff`\] Ignore `str()` when not used for simple conversion (`RUF065`) ([#21330](https://github.com/astral-sh/ruff/pull/21330))
14+
15+
### Bug fixes
16+
17+
- Fix syntax error false positive on alternative `match` patterns ([#21362](https://github.com/astral-sh/ruff/pull/21362))
18+
- \[`flake8-simplify`\] Fix false positive for iterable initializers with generator arguments (`SIM222`) ([#21187](https://github.com/astral-sh/ruff/pull/21187))
19+
- \[`pyupgrade`\] Fix false positive on relative imports from local `.builtins` module (`UP029`) ([#21309](https://github.com/astral-sh/ruff/pull/21309))
20+
- \[`pyupgrade`\] Consistently set the deprecated tag (`UP035`) ([#21396](https://github.com/astral-sh/ruff/pull/21396))
21+
22+
### Rule changes
23+
24+
- \[`refurb`\] Detect empty f-strings (`FURB105`) ([#21348](https://github.com/astral-sh/ruff/pull/21348))
25+
26+
### CLI
27+
28+
- Add option to provide a reason to `--add-noqa` ([#21294](https://github.com/astral-sh/ruff/pull/21294))
29+
- Add upstream linter URL to `ruff linter --output-format=json` ([#21316](https://github.com/astral-sh/ruff/pull/21316))
30+
- Add color to `--help` ([#21337](https://github.com/astral-sh/ruff/pull/21337))
31+
32+
### Documentation
33+
34+
- Add a new "Opening a PR" section to the contribution guide ([#21298](https://github.com/astral-sh/ruff/pull/21298))
35+
- Added the PyScripter IDE to the list of "Who is using Ruff?" ([#21402](https://github.com/astral-sh/ruff/pull/21402))
36+
- Update PyCharm setup instructions ([#21409](https://github.com/astral-sh/ruff/pull/21409))
37+
- \[`flake8-annotations`\] Add link to `allow-star-arg-any` option (`ANN401`) ([#21326](https://github.com/astral-sh/ruff/pull/21326))
38+
39+
### Other changes
40+
41+
- \[`configuration`\] Improve error message when `line-length` exceeds `u16::MAX` ([#21329](https://github.com/astral-sh/ruff/pull/21329))
42+
43+
### Contributors
44+
45+
- [@njhearp](https://github.com/njhearp)
46+
- [@11happy](https://github.com/11happy)
47+
- [@hugovk](https://github.com/hugovk)
48+
- [@Gankra](https://github.com/Gankra)
49+
- [@ntBre](https://github.com/ntBre)
50+
- [@pyscripter](https://github.com/pyscripter)
51+
- [@danparizher](https://github.com/danparizher)
52+
- [@MichaReiser](https://github.com/MichaReiser)
53+
- [@henryiii](https://github.com/henryiii)
54+
- [@charliecloudberry](https://github.com/charliecloudberry)
55+
356
## 0.14.4
457

558
Released on 2025-11-06.

Cargo.lock

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

README.md

Lines changed: 4 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.4/install.sh | sh
151-
powershell -c "irm https://astral.sh/ruff/0.14.4/install.ps1 | iex"
150+
curl -LsSf https://astral.sh/ruff/0.14.5/install.sh | sh
151+
powershell -c "irm https://astral.sh/ruff/0.14.5/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.4
184+
rev: v0.14.5
185185
hooks:
186186
# Run the linter.
187187
- id: ruff-check
@@ -491,6 +491,7 @@ Ruff is used by a number of major open-source projects and companies, including:
491491
- [PyTorch](https://github.com/pytorch/pytorch)
492492
- [Pydantic](https://github.com/pydantic/pydantic)
493493
- [Pylint](https://github.com/PyCQA/pylint)
494+
- [PyScripter](https://github.com/pyscripter/pyscripter)
494495
- [PyVista](https://github.com/pyvista/pyvista)
495496
- [Reflex](https://github.com/reflex-dev/reflex)
496497
- [River](https://github.com/online-ml/river)

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.4"
3+
version = "0.14.5"
44
publish = true
55
authors = { workspace = true }
66
edition = { workspace = true }

crates/ruff/src/args.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,13 @@ pub struct CheckCommand {
415415
)]
416416
pub statistics: bool,
417417
/// Enable automatic additions of `noqa` directives to failing lines.
418+
/// Optionally provide a reason to append after the codes.
418419
#[arg(
419420
long,
421+
value_name = "REASON",
422+
default_missing_value = "",
423+
num_args = 0..=1,
424+
require_equals = true,
420425
// conflicts_with = "add_noqa",
421426
conflicts_with = "show_files",
422427
conflicts_with = "show_settings",
@@ -428,7 +433,7 @@ pub struct CheckCommand {
428433
conflicts_with = "fix",
429434
conflicts_with = "diff",
430435
)]
431-
pub add_noqa: bool,
436+
pub add_noqa: Option<String>,
432437
/// See the files Ruff will be run against with the current settings.
433438
#[arg(
434439
long,
@@ -1057,7 +1062,7 @@ Possible choices:
10571062
/// etc.).
10581063
#[expect(clippy::struct_excessive_bools)]
10591064
pub struct CheckArguments {
1060-
pub add_noqa: bool,
1065+
pub add_noqa: Option<String>,
10611066
pub diff: bool,
10621067
pub exit_non_zero_on_fix: bool,
10631068
pub exit_zero: bool,

crates/ruff/src/commands/add_noqa.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub(crate) fn add_noqa(
2121
files: &[PathBuf],
2222
pyproject_config: &PyprojectConfig,
2323
config_arguments: &ConfigArguments,
24+
reason: Option<&str>,
2425
) -> Result<usize> {
2526
// Collect all the files to check.
2627
let start = Instant::now();
@@ -76,7 +77,14 @@ pub(crate) fn add_noqa(
7677
return None;
7778
}
7879
};
79-
match add_noqa_to_path(path, package, &source_kind, source_type, &settings.linter) {
80+
match add_noqa_to_path(
81+
path,
82+
package,
83+
&source_kind,
84+
source_type,
85+
&settings.linter,
86+
reason,
87+
) {
8088
Ok(count) => Some(count),
8189
Err(e) => {
8290
error!("Failed to add noqa to {}: {e}", path.display());

0 commit comments

Comments
 (0)