diff --git a/resources/test/fixtures/eradicate/ERA001.py b/resources/test/fixtures/eradicate/ERA001.py index e4ee9bfad7..4d79010d35 100644 --- a/resources/test/fixtures/eradicate/ERA001.py +++ b/resources/test/fixtures/eradicate/ERA001.py @@ -5,9 +5,11 @@ a = 4 #foo(1, 2, 3) def foo(x, y, z): - contentet = 1 # print('hello') + content = 1 # print('hello') print(x, y, z) # This is a real comment. #return True return False + +#import os # noqa: ERA001 diff --git a/src/eradicate/detection.rs b/src/eradicate/detection.rs index 000cec2726..ad1b2c2bc9 100644 --- a/src/eradicate/detection.rs +++ b/src/eradicate/detection.rs @@ -4,7 +4,7 @@ use regex::Regex; static ALLOWLIST_REGEX: Lazy = Lazy::new(|| { Regex::new( - r"(?i)pylint|pyright|noqa|nosec|type:\s*ignore|fmt:\s*(on|off)|isort:\s*(on|off|skip|skip_file|split|dont-add-imports(:\s*\[.*?])?)|TODO|FIXME|XXX" + r"^(?i)(?:pylint|pyright|noqa|nosec|type:\s*ignore|fmt:\s*(on|off)|isort:\s*(on|off|skip|skip_file|split|dont-add-imports(:\s*\[.*?])?)|TODO|FIXME|XXX)" ).unwrap() }); static BRACKET_REGEX: Lazy = Lazy::new(|| Regex::new(r"^[()\[\]{}\s]+$").unwrap());