다음은 # bypass_pyflakes
주석 옵션 을 추가하는 pyflakes의 원숭이 패치입니다 .
bypass_pyflakes.py
#!/usr/bin/env 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('bypass_pyflakes') >= 0:
return
self.messages.append(messageClass(self.filename, *args, **kwargs))
# monkey patch checker to support bypass
Checker.report = report_with_bypass
pyflakes.main()
이것을로 저장하면을 (를)로 bypass_pyflakes.py
호출 할 수 있습니다 python bypass_pyflakes.py myfile.py
.
http://chase-seibert.github.com/blog/2013/01/11/bypass_pyflakes.html