Skip to content

Commit 8524583

Browse files
committed
Merge remote-tracking branch 'origin/main' into dcreager/non-non-inferable
* origin/main: [ty] Support dataclass-transform `field_specifiers` (#20888) Bump 0.14.1 (#20925) Standardize syntax error construction (#20903) [`pydoclint`] Implement `docstring-extraneous-parameter` (`DOC102`) (#20376) [ty] Fix panic 'missing root' when handling completion request (#20917) [ty] Run file watching tests serial when using nextest (#20918) [ty] Add version hint for failed stdlib attribute accesses (#20909) More CI improvements (#20920) [ty] Check typeshed VERSIONS for parent modules when reporting failed stdlib imports (#20908)
2 parents ff112ad + 8dad58d commit 8524583

Some content is hidden

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

51 files changed

+2338
-434
lines changed

.config/nextest.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# Define serial test group for running tests sequentially.
2+
[test-groups]
3+
serial = { max-threads = 1 }
4+
5+
# Run ty file watching tests sequentially to avoid race conditions.
6+
[[profile.default.overrides]]
7+
filter = 'binary(file_watching)'
8+
test-group = 'serial'
9+
110
[profile.ci]
211
# Print out output for failing tests as soon as they fail, and also at the end
312
# of the run (for easy scrollability).

.github/workflows/ci.yaml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@ concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
1313
cancel-in-progress: true
1414

15+
defaults:
16+
run:
17+
shell: bash
18+
1519
env:
1620
CARGO_INCREMENTAL: 0
1721
CARGO_NET_RETRY: 10
1822
CARGO_TERM_COLOR: always
1923
RUSTUP_MAX_RETRIES: 10
2024
PACKAGE_NAME: ruff
2125
PYTHON_VERSION: "3.13"
26+
NEXTEST_PROFILE: ci
2227

2328
jobs:
2429
determine_changes:
@@ -271,9 +276,6 @@ jobs:
271276
# This step is just to get nice GitHub annotations on the PR diff in the files-changed tab.
272277
run: cargo test -p ty_python_semantic --test mdtest || true
273278
- name: "Run tests"
274-
shell: bash
275-
env:
276-
NEXTEST_PROFILE: "ci"
277279
run: cargo insta test --all-features --unreferenced reject --test-runner nextest
278280

279281
# Check for broken links in the documentation.
@@ -299,9 +301,13 @@ jobs:
299301

300302
cargo-test-linux-release:
301303
name: "cargo test (linux, release)"
302-
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
304+
# release builds timeout on GitHub runners, so this job is just skipped on forks in the `if` check
305+
runs-on: depot-ubuntu-22.04-16
303306
needs: determine_changes
304-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }}
307+
if: |
308+
github.repository == 'astral-sh/ruff' &&
309+
!contains(github.event.pull_request.labels.*.name, 'no-test') &&
310+
(needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main')
305311
timeout-minutes: 20
306312
steps:
307313
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -325,9 +331,6 @@ jobs:
325331
with:
326332
enable-cache: "true"
327333
- name: "Run tests"
328-
shell: bash
329-
env:
330-
NEXTEST_PROFILE: "ci"
331334
run: cargo insta test --release --all-features --unreferenced reject --test-runner nextest
332335

333336
cargo-test-windows:
@@ -352,9 +355,7 @@ jobs:
352355
with:
353356
enable-cache: "true"
354357
- name: "Run tests"
355-
shell: bash
356358
env:
357-
NEXTEST_PROFILE: "ci"
358359
# Workaround for <https://github.com/nextest-rs/nextest/issues/1493>.
359360
RUSTUP_WINDOWS_PATH_ADD_BIN: 1
360361
run: |
@@ -385,9 +386,6 @@ jobs:
385386
with:
386387
enable-cache: "true"
387388
- name: "Run tests"
388-
shell: bash
389-
env:
390-
NEXTEST_PROFILE: "ci"
391389
run: |
392390
cargo nextest run --all-features --profile ci
393391
cargo test --all-features --doc
@@ -445,7 +443,6 @@ jobs:
445443
- name: "Install mold"
446444
uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
447445
- name: "Build tests"
448-
shell: bash
449446
env:
450447
MSRV: ${{ steps.msrv.outputs.value }}
451448
run: cargo "+${MSRV}" test --no-run --all-features

.github/workflows/mypy_primer.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ concurrency:
1919
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
2020
cancel-in-progress: true
2121

22+
defaults:
23+
run:
24+
shell: bash
25+
2226
env:
2327
CARGO_INCREMENTAL: 0
2428
CARGO_NET_RETRY: 10
@@ -49,7 +53,6 @@ jobs:
4953
run: rustup show
5054

5155
- name: Run mypy_primer
52-
shell: bash
5356
env:
5457
PRIMER_SELECTOR: crates/ty_python_semantic/resources/primer/good.txt
5558
DIFF_FILE: mypy_primer.diff
@@ -92,7 +95,6 @@ jobs:
9295
run: rustup show
9396

9497
- name: Run mypy_primer
95-
shell: bash
9698
env:
9799
TY_MAX_PARALLELISM: 1 # for deterministic memory numbers
98100
TY_MEMORY_REPORT: mypy_primer

.github/workflows/sync_typeshed.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,18 @@ on:
2828
# Run on the 1st and the 15th of every month:
2929
- cron: "0 0 1,15 * *"
3030

31+
defaults:
32+
run:
33+
shell: bash
34+
3135
env:
3236
# Don't set this flag globally for the workflow: it does strange things
3337
# to the snapshots in the `cargo insta test --accept` step in the MacOS job.
3438
#
3539
# FORCE_COLOR: 1
3640

3741
CARGO_TERM_COLOR: always
42+
NEXTEST_PROFILE: "ci"
3843
GH_TOKEN: ${{ github.token }}
3944

4045
# The name of the upstream branch that the first worker creates,
@@ -133,7 +138,6 @@ jobs:
133138
git config --global user.email '<>'
134139
- name: Sync Windows docstrings
135140
id: docstrings
136-
shell: bash
137141
env:
138142
FORCE_COLOR: 1
139143
run: ./scripts/codemod_docstrings.sh

CHANGELOG.md

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

3+
## 0.14.1
4+
5+
Released on 2025-10-16.
6+
7+
### Preview features
8+
9+
- [formatter] Remove parentheses around multiple exception types on Python 3.14+ ([#20768](https://github.com/astral-sh/ruff/pull/20768))
10+
- \[`flake8-bugbear`\] Omit annotation in preview fix for `B006` ([#20877](https://github.com/astral-sh/ruff/pull/20877))
11+
- \[`flake8-logging-format`\] Avoid dropping implicitly concatenated pieces in the `G004` fix ([#20793](https://github.com/astral-sh/ruff/pull/20793))
12+
- \[`pydoclint`\] Implement `docstring-extraneous-parameter` (`DOC102`) ([#20376](https://github.com/astral-sh/ruff/pull/20376))
13+
- \[`pyupgrade`\] Extend `UP019` to detect `typing_extensions.Text` (`UP019`) ([#20825](https://github.com/astral-sh/ruff/pull/20825))
14+
- \[`pyupgrade`\] Fix false negative for `TypeVar` with default argument in `non-pep695-generic-class` (`UP046`) ([#20660](https://github.com/astral-sh/ruff/pull/20660))
15+
16+
### Bug fixes
17+
18+
- Fix false negatives in `Truthiness::from_expr` for lambdas, generators, and f-strings ([#20704](https://github.com/astral-sh/ruff/pull/20704))
19+
- Fix syntax error false positives for escapes and quotes in f-strings ([#20867](https://github.com/astral-sh/ruff/pull/20867))
20+
- Fix syntax error false positives on parenthesized context managers ([#20846](https://github.com/astral-sh/ruff/pull/20846))
21+
- \[`fastapi`\] Fix false positives for path parameters that FastAPI doesn't recognize (`FAST003`) ([#20687](https://github.com/astral-sh/ruff/pull/20687))
22+
- \[`flake8-pyi`\] Fix operator precedence by adding parentheses when needed (`PYI061`) ([#20508](https://github.com/astral-sh/ruff/pull/20508))
23+
- \[`ruff`\] Suppress diagnostic for f-string interpolations with debug text (`RUF010`) ([#20525](https://github.com/astral-sh/ruff/pull/20525))
24+
25+
### Rule changes
26+
27+
- \[`airflow`\] Add warning to `airflow.datasets.DatasetEvent` usage (`AIR301`) ([#20551](https://github.com/astral-sh/ruff/pull/20551))
28+
- \[`flake8-bugbear`\] Mark `B905` and `B912` fixes as unsafe ([#20695](https://github.com/astral-sh/ruff/pull/20695))
29+
- Use `DiagnosticTag` for more rules - changes display in editors ([#20758](https://github.com/astral-sh/ruff/pull/20758),[#20734](https://github.com/astral-sh/ruff/pull/20734))
30+
31+
### Documentation
32+
33+
- Update Python compatibility from 3.13 to 3.14 in README.md ([#20852](https://github.com/astral-sh/ruff/pull/20852))
34+
- Update `lint.flake8-type-checking.quoted-annotations` docs ([#20765](https://github.com/astral-sh/ruff/pull/20765))
35+
- Update setup instructions for Zed 0.208.0+ ([#20902](https://github.com/astral-sh/ruff/pull/20902))
36+
- \[`flake8-datetimez`\] Clarify docs for several rules ([#20778](https://github.com/astral-sh/ruff/pull/20778))
37+
- Fix typo in `RUF015` description ([#20873](https://github.com/astral-sh/ruff/pull/20873))
38+
39+
### Other changes
40+
41+
- Reduce binary size ([#20863](https://github.com/astral-sh/ruff/pull/20863))
42+
- Improved error recovery for unclosed strings (including f- and t-strings) ([#20848](https://github.com/astral-sh/ruff/pull/20848))
43+
44+
### Contributors
45+
46+
- [@ntBre](https://github.com/ntBre)
47+
- [@Paillat-dev](https://github.com/Paillat-dev)
48+
- [@terror](https://github.com/terror)
49+
- [@pieterh-oai](https://github.com/pieterh-oai)
50+
- [@MichaReiser](https://github.com/MichaReiser)
51+
- [@TaKO8Ki](https://github.com/TaKO8Ki)
52+
- [@ageorgou](https://github.com/ageorgou)
53+
- [@danparizher](https://github.com/danparizher)
54+
- [@mgaitan](https://github.com/mgaitan)
55+
- [@augustelalande](https://github.com/augustelalande)
56+
- [@dylwil3](https://github.com/dylwil3)
57+
- [@Lee-W](https://github.com/Lee-W)
58+
- [@injust](https://github.com/injust)
59+
- [@CarrotManMatt](https://github.com/CarrotManMatt)
60+
361
## 0.14.0
462

563
Released on 2025-10-07.

Cargo.lock

Lines changed: 3 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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ curl -LsSf https://astral.sh/ruff/install.sh | sh
148148
powershell -c "irm https://astral.sh/ruff/install.ps1 | iex"
149149

150150
# For a specific version.
151-
curl -LsSf https://astral.sh/ruff/0.14.0/install.sh | sh
152-
powershell -c "irm https://astral.sh/ruff/0.14.0/install.ps1 | iex"
151+
curl -LsSf https://astral.sh/ruff/0.14.1/install.sh | sh
152+
powershell -c "irm https://astral.sh/ruff/0.14.1/install.ps1 | iex"
153153
```
154154

155155
You can also install Ruff via [Homebrew](https://formulae.brew.sh/formula/ruff), [Conda](https://anaconda.org/conda-forge/ruff),
@@ -182,7 +182,7 @@ Ruff can also be used as a [pre-commit](https://pre-commit.com/) hook via [`ruff
182182
```yaml
183183
- repo: https://github.com/astral-sh/ruff-pre-commit
184184
# Ruff version.
185-
rev: v0.14.0
185+
rev: v0.14.1
186186
hooks:
187187
# Run the linter.
188188
- 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.0"
3+
version = "0.14.1"
44
publish = true
55
authors = { workspace = true }
66
edition = { workspace = true }

crates/ruff/src/diagnostics.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use log::{debug, warn};
1313
use ruff_db::diagnostic::Diagnostic;
1414
use ruff_linter::codes::Rule;
1515
use ruff_linter::linter::{FixTable, FixerResult, LinterResult, ParseSource, lint_fix, lint_only};
16-
use ruff_linter::message::create_syntax_error_diagnostic;
1716
use ruff_linter::package::PackageRoot;
1817
use ruff_linter::pyproject_toml::lint_pyproject_toml;
1918
use ruff_linter::settings::types::UnsafeFixes;
@@ -103,11 +102,7 @@ impl Diagnostics {
103102
let name = path.map_or_else(|| "-".into(), Path::to_string_lossy);
104103
let dummy = SourceFileBuilder::new(name, "").finish();
105104
Self::new(
106-
vec![create_syntax_error_diagnostic(
107-
dummy,
108-
err,
109-
TextRange::default(),
110-
)],
105+
vec![Diagnostic::invalid_syntax(dummy, err, TextRange::default())],
111106
FxHashMap::default(),
112107
)
113108
}

crates/ruff_db/src/diagnostic/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,14 @@ impl Diagnostic {
8484
/// at time of writing, `ruff_db` depends on `ruff_python_parser` instead of
8585
/// the other way around. And since we want to do this conversion in a couple
8686
/// places, it makes sense to centralize it _somewhere_. So it's here for now.
87-
///
88-
/// Note that `message` is stored in the primary annotation, _not_ in the primary diagnostic
89-
/// message.
9087
pub fn invalid_syntax(
9188
span: impl Into<Span>,
9289
message: impl IntoDiagnosticMessage,
9390
range: impl Ranged,
9491
) -> Diagnostic {
95-
let mut diag = Diagnostic::new(DiagnosticId::InvalidSyntax, Severity::Error, "");
92+
let mut diag = Diagnostic::new(DiagnosticId::InvalidSyntax, Severity::Error, message);
9693
let span = span.into().with_range(range.range());
97-
diag.annotate(Annotation::primary(span).message(message));
94+
diag.annotate(Annotation::primary(span));
9895
diag
9996
}
10097

0 commit comments

Comments
 (0)