Fix case sensitivity

This commit is contained in:
alstr
2024-01-08 18:58:31 +00:00
parent 4453da85d8
commit aae81c5ce3

14
main.py
View File

@@ -292,11 +292,11 @@ class TodoParser(object):
ADDITION_PATTERN = re.compile(r'(?<=^\+).*') ADDITION_PATTERN = re.compile(r'(?<=^\+).*')
DELETION_PATTERN = re.compile(r'(?<=^-).*') DELETION_PATTERN = re.compile(r'(?<=^-).*')
REF_PATTERN = re.compile(r'.+?(?=\))') REF_PATTERN = re.compile(r'.+?(?=\))')
LABELS_PATTERN = re.compile(r'(?<=labels:\s).+') LABELS_PATTERN = re.compile(r'(?<=labels:\s).+', re.IGNORECASE)
ASSIGNEES_PATTERN = re.compile(r'(?<=assignees:\s).+') ASSIGNEES_PATTERN = re.compile(r'(?<=assignees:\s).+', re.IGNORECASE)
MILESTONE_PATTERN = re.compile(r'(?<=milestone:\s).+') MILESTONE_PATTERN = re.compile(r'(?<=milestone:\s).+', re.IGNORECASE)
USER_PROJECTS_PATTERN = re.compile(r'(?<=user projects:\s).+') USER_PROJECTS_PATTERN = re.compile(r'(?<=user projects:\s).+', re.IGNORECASE)
ORG_PROJECTS_PATTERN = re.compile(r'(?<=org projects:\s).+') ORG_PROJECTS_PATTERN = re.compile(r'(?<=org projects:\s).+', re.IGNORECASE)
def __init__(self): def __init__(self):
# Determine if the Issues should be escaped. # Determine if the Issues should be escaped.
@@ -706,13 +706,13 @@ class TodoParser(object):
title_identifier = None title_identifier = None
for identifier in self.identifiers: for identifier in self.identifiers:
title_identifier = identifier title_identifier = identifier
title_pattern = re.compile(r'(?<=' + identifier + r'[\s:]).+') title_pattern = re.compile(r'(?<=' + identifier + r'[\s:]).+', re.IGNORECASE)
title_search = title_pattern.search(comment, re.IGNORECASE) title_search = title_pattern.search(comment, re.IGNORECASE)
if title_search: if title_search:
title = title_search.group(0).strip() title = title_search.group(0).strip()
break break
else: else:
title_ref_pattern = re.compile(r'(?<=' + identifier + r'\().+') title_ref_pattern = re.compile(r'(?<=' + identifier + r'\().+', re.IGNORECASE)
title_ref_search = title_ref_pattern.search(comment, re.IGNORECASE) title_ref_search = title_ref_pattern.search(comment, re.IGNORECASE)
if title_ref_search: if title_ref_search:
title = title_ref_search.group(0).strip() title = title_ref_search.group(0).strip()