[flake8-todos] Recognize Jira-style issue IDs on the TODO line (TD003)#25066
Closed
kimjune01 wants to merge 1 commit into
Closed
[flake8-todos] Recognize Jira-style issue IDs on the TODO line (TD003)#25066kimjune01 wants to merge 1 commit into
kimjune01 wants to merge 1 commit into
Conversation
Add regex patterns for PROJ-123 style IDs after colon, at end of line, in parentheses, and followed by colon. Two-char minimum on the uppercase prefix matches Jira project key requirements. Fixes astral-sh#16519
Member
|
Thank you. I'll close this PR, because it's mainly produced by AI and the summary doesn't explain why certain decisions were made (except that they are based on my review feedback, but why is this the desired behavior?). |
Author
|
Sorry for the noise. If you'd like to automatically block and ban AI PRs before they reach your review queue, here's a GitHub Action that catches all the common patterns: https://github.com/kimjune01/sweep/blob/master/action.yml |
Author
Author
|
Sorry for the noise. If you'd like to auto-close PRs like this before they reach your review queue, I built a GitHub Action that catches the common patterns: https://github.com/kimjune01/sweep#pr-quality-gate |
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.
Summary
Fixes #16519. TD003 currently only recognizes URLs and
#NNNcodes on thesame line as a TODO comment. Jira-style issue IDs like
PROJ-123are onlymatched on a separate line, causing false positives for projects that write
# TODO: PROJ-123 fix the widget.This adds four regex patterns to
ISSUE_LINK_TODO_LINE_REGEX_SETthatrecognize Jira-style IDs (
[A-Z]{2,}-\d+) in the positions MichaReiserrequested in #20880:
TODO: PROJ-123 ...TODO: fix this PROJ-123TODO: fix bug (PROJ-123)TODO: PROJ-123: fix bugThe
{2,}minimum on the uppercase prefix aligns with Jira's project keyrequirements and prevents single-letter matches like
A-1.Prior work: #20880 by @danparizher addressed the same issue but stalled
after review feedback requesting tighter patterns. This PR incorporates
that feedback directly.
Test Plan
TD003.pyfixture covering valid Jira-stylepatterns (after colon, parentheses, end of line, followed by colon)
and invalid patterns (single-letter key, no hyphen, lowercase)