fix: flag EM103 on f-string .format() receivers#88
Merged
Conversation
EM103 only matched `.format()` on a plain string Constant, so
`raise RuntimeError(f"{x}".format())` slipped through every check. Extend
the pattern to also match a JoinedStr (f-string) receiver.
Refs #86
Assisted-by: ClaudeCode:claude-opus-4.8
Merged
henryiii
added a commit
that referenced
this pull request
Jun 18, 2026
Bumping to 0.7.0 instead of 0.6.1 because the format f-string fix could trigger a new discovery that was missed before. --- ### Fixed - EM103 now flags `.format()` receivers on f-strings (#88) — previously missed. - EM106 no longer false-positives on walruses inside nested lambdas (#87). - Corrected plugin version reported by the plugin, dropped dead code, and tidied error constructors (#85). ### Tests - Added coverage for CLI paths and the string-length boundary; clarified the `cls` comment (#89). ### Chores / CI - Support Python 3.15 (#92) - Support pylint 4 (#72). - `pytest` config switched to `log_level` over `log_cli_level` (#75). - Added an `AGENTS` file (#84). - Bumped `setup-uv` (6→7, then to the maintained tag scheme, then 8.1.0→8.2.0), `download-artifact` (5→6), and other grouped action updates (#90, #82, #80, #74, #71, #70). - Several routine pre-commit hook updates (#83, #79, #77, #73, #69). Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
Closes item 2 of #86.
EM103 only matched
.format()when the receiver was a plain stringConstant, so an f-string receiver slipped through every check:The pattern now also matches an
ast.JoinedStrreceiver, reporting it as EM103 (the construct is a direct.format()call). Addedtest_err2b_fstring_format. All tests pass.