heat-cfntools/tools/pyflakes-bypass.py
Steve Baker 54acd090a8 Add tox, pep8, pyflakes, testr support
Also fix the python to comply. This has to be done as a single
change otherwise we'll never bootstrap gating.

Change-Id: I4a21d57e0341802a1652428dee16c60abb30251d
2013-03-07 12:28:29 +13:00

16 lines
467 B
Python

from pyflakes.scripts import pyflakes
from pyflakes.checker import Checker
def report_with_bypass(self, messageClass, *args, **kwargs):
text_lineno = args[0] - 1
with open(self.filename, 'r') as code:
if code.readlines()[text_lineno].find('pyflakes_bypass') >= 0:
return
self.messages.append(messageClass(self.filename, *args, **kwargs))
# monkey patch checker to support bypass
Checker.report = report_with_bypass
pyflakes.main()