rjgoyln opened a new pull request, #73166:
URL: https://github.com/apache/airflow/pull/73166

   ## Summary
   
   Ruff's `EM102` (`f-string-in-exception`) cannot go into `extend-select`: the 
repository carries 2478 f-string exception messages across 837 files, and 
rewriting them in one commit would conflict with every open pull request.
   
   This applies the ratchet the repository already uses for `raise 
AirflowException` and for positional `@provide_session` arguments, so the rule 
binds new code while the existing occurrences are cleared at whatever pace 
contributors choose.
   
   ## Change
   
   - Add `check-no-new-fstring-in-exception` over `airflow-core`, 
`airflow-ctl`, `providers`, `shared` and `task-sdk`.
   - Grandfather the existing occurrences as per-file counts in 
`generated/known_fstring_exceptions.txt`.
   - Tighten an entry whenever a file's count drops, so the allowlist only ever 
ratchets down.
   
   Clearing an area is `ruff check --select EM102 --unsafe-fixes --fix` over it 
plus the tightened allowlist.
   
   ## Tests
   
   Detection uses `ast` rather than invoking ruff, so it was checked against 
ruff over the five scanned roots: both report 2478 occurrences in 837 files 
with no per-file disagreement, and they agree on implicit concatenation, 
placeholder-less f-strings, keyword and starred arguments, `raise X(...) from 
err`, `raise X` without a call, and t-strings.
   
   A file that fails to parse counts as unknown rather than zero. Zero would 
read as a clean-up and delete that file's grandfathered entry, after which its 
pre-existing usages come back as new.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5)
   
   Generated-by: Claude Code (Opus 5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to