Skip to content

Fix spurious nosec warning on f-strings#6

Open
yashwant86 wants to merge 2 commits intomainfrom
pr-1362
Open

Fix spurious nosec warning on f-strings#6
yashwant86 wants to merge 2 commits intomainfrom
pr-1362

Conversation

@yashwant86
Copy link
Copy Markdown

Mirror of PyCQA#1362

worksbyfriday and others added 2 commits February 17, 2026 09:18
When a `# nosec B608` comment successfully suppressed an issue in an
f-string, bandit emitted a spurious warning "nosec encountered (B608),
but no failed test on line N" for the other Constant sub-nodes of the
JoinedStr that intentionally returned no result.

Track which (test_id, line) pairs have been suppressed and skip the
warning when the same test was already suppressed on the same line range.

Fixes PyCQA#1204

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants