From 42231ff1ecd5459402afebf3d5d2f21e579cd161 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Fri, 8 Feb 2013 18:19:26 -0500 Subject: [PATCH] Fixes #58 --- flake8/util.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flake8/util.py b/flake8/util.py index 3d16594..d98c0ba 100644 --- a/flake8/util.py +++ b/flake8/util.py @@ -123,7 +123,13 @@ def skip_warning(warning, ignore=[]): def skip_line(line): - return line.strip().lower().endswith('# noqa') + def _noqa(line): + return line.strip().lower().endswith('# noqa') + skip = _noqa(line) + if not skip: + i = line.rfind(' #') + skip = _noqa(line[:i]) if i > 0 else False + return skip _NOQA = re.compile(r'flake8[:=]\s*noqa', re.I | re.M)