Skip to content

Commit

Permalink
fix: perform case-insensitive search for identifier
Browse files Browse the repository at this point in the history
When searching for the comment line after which
the issue URL will be inserted, use a case-insensitive
search for the identifier portion of the line.
This matches how TodoParser identifies TODOs using
a case-insensitive search.

Closes github.com/alstr#224
  • Loading branch information
rgalonso committed Nov 9, 2024
1 parent 06c9536 commit f752af8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def process_diff(diff, client=Client(), insert_issue_urls=False, parser=TodoPars
if line_number < len(file_lines):
# Duplicate the line to retain the comment syntax.
old_line = file_lines[line_number]
remove = fr'{raw_issue.identifier}.*{raw_issue.title}'
remove = fr'(?i:{raw_issue.identifier}).*{raw_issue.title}'
insert = f'Issue URL: {client.get_issue_url(new_issue_number)}'
new_line = re.sub(remove, insert, old_line)
# make sure the above operation worked as intended
Expand Down

0 comments on commit f752af8

Please sign in to comment.