diff --git a/bugbug/bug_features.py b/bugbug/bug_features.py index 5680f3b0..2673b202 100644 --- a/bugbug/bug_features.py +++ b/bugbug/bug_features.py @@ -182,10 +182,15 @@ def cleanup_fileref(text): def cleanup_synonyms(text): - synonyms = [('safemode', ['safe mode', 'safemode'])] + synonyms = [ + ('safemode', ['safemode', 'safe mode']), + ('str', ['str', 'steps to reproduce', 'repro steps']), + ('uaf', ['uaf', 'use after free', 'use-after-free']), + ('asan', ['asan', 'address sanitizer']), + ] for synonym_group, synonym_list in synonyms: - text = re.sub('|'.join(synonym_list), synonym_group, text) + text = re.sub('|'.join(synonym_list), synonym_group, text, flags=re.IGNORECASE) return text diff --git a/tests/test_cleanup_functions.py b/tests/test_cleanup_functions.py index 27cf4c21..6e683d8e 100644 --- a/tests/test_cleanup_functions.py +++ b/tests/test_cleanup_functions.py @@ -28,6 +28,10 @@ def test_cleanup_fileref(): def test_cleanup_synonyms(): tests = [ ('I was in safemode, but the problem occurred in safe mode too', 'I was in safemode, but the problem occurred in safemode too'), + ('SAFE MODE or SAFEMODE?', 'safemode or safemode?'), + ('are there str? steps to reproduce? repro steps?', 'are there str? str? str?'), + ('this is a use-after-free, also called uaf, also called use after free', 'this is a uaf, also called uaf, also called uaf'), + ('found via address sanitizer or asan', 'found via asan or asan'), ] for orig_text, cleaned_text in tests: assert bug_features.cleanup_synonyms(orig_text) == cleaned_text