Skip to content

Comments

[ruff] Handle argfile expansion errors gracefully#20691

Merged
ntBre merged 3 commits intoastral-sh:mainfrom
TaKO8Ki:fix-argfile-expansion-error
Oct 3, 2025
Merged

[ruff] Handle argfile expansion errors gracefully#20691
ntBre merged 3 commits intoastral-sh:mainfrom
TaKO8Ki:fix-argfile-expansion-error

Conversation

@TaKO8Ki
Copy link
Contributor

@TaKO8Ki TaKO8Ki commented Oct 3, 2025

Summary

Fixes #20655

  • Guard argfile::expand_args_from with contextual error handling so missing @file arguments surface a friendly failure instead of panicking.
  • Extract existing stderr reporting into report_error for reuse on both CLI parsing failures and runtime errors.

Test Plan

Add a regression test to integration_test.rs.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre ntBre added bug Something isn't working cli Related to the command-line interface labels Oct 3, 2025
Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thank you!

I just had one tiny nit that I'll try to apply and merge.

@ntBre ntBre enabled auto-merge (squash) October 3, 2025 13:32
@ntBre ntBre merged commit 7d7237c into astral-sh:main Oct 3, 2025
35 checks passed
@TaKO8Ki TaKO8Ki deleted the fix-argfile-expansion-error branch October 3, 2025 13:42
dcreager added a commit that referenced this pull request Oct 3, 2025
* origin/main:
  [`flake8-bugbear`] Include certain guaranteed-mutable expressions: tuples, generators, and assignment expressions (`B006`) (#20024)
  [`flake8-comprehensions`] Clarify fix safety documentation (`C413`) (#20640)
  [ty] improve base conda distinction from child conda (#20675)
  [`ruff`] Extend FA102 with listed PEP 585-compatible APIs (#20659)
  [`ruff`] Handle argfile expansion errors gracefully (#20691)
  [`flynt`] Fix f-string quoting for mixed quote joiners (`FLY002`) (#20662)
  [ty] Fix file root matching for `/`
  [ruff,ty] Enable tracing's `log` feature
  [`flake8-annotations`] Fix return type annotations to handle shadowed builtin symbols (`ANN201`, `ANN202`, `ANN204`, `ANN205`, `ANN206`) (#20612)
  Bump 0.13.3 (#20685)
  Update benchmarking CI for cargo-codspeed v4 (#20686)
  [ty] Support single-starred argument for overload call (#20223)
  [ty] `~T` should never be assignable to `T` (#20606)
  [`pylint`] Clarify fix safety to include left-hand hashability (`PLR6201`) (#20518)
  [ty] No union with `Unknown` for module-global symbols (#20664)
  [`ty`] Reject renaming files to start with slash in Playground (#20666)
  [ty] Enums: allow multiple aliases to point to the same member (#20669)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cli Related to the command-line interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trying to use a non-existent fromfile with a leading special character panics instead of giving nice error

2 participants