コード例 #1
0
ファイル: run.py プロジェクト: jblomo/dotfiles
def check_code(code, complexity=-1):
    warnings = pyflakes.check(code, '<stdin>')
    if complexity > -1:
        warnings += mccabe.get_code_complexity(code, complexity)
    return warnings
コード例 #2
0
ファイル: test_flakes.py プロジェクト: shenkan/flake8
 def test_import_exception_in_scope(self):
     self.assertEqual(check(code_import_exception), 0)
コード例 #3
0
ファイル: run.py プロジェクト: brightwill/flake8
def check_code(code, complexity=-1):
    warnings = pyflakes.check(code, 'stdin')
    warnings += pep8style.input_file(StringIO(code))
    if complexity > -1:
        warnings += mccabe.get_code_complexity(code, complexity)
    return warnings
コード例 #4
0
def pyflakes_check(code_string):
    pyflakes.check(code_string, '')
コード例 #5
0
ファイル: test_flakes.py プロジェクト: shenkan/flake8
 def test_exception(self):
     for c in (code, code2, code3):
         warnings = check(code)
         self.assertEqual(warnings, 0, code)
コード例 #6
0
def check_code(code, complexity=-1):
    warnings = pyflakes.check(code, 'stdin')
    warnings += pep8style.input_file(StringIO(code))
    if complexity > -1:
        warnings += mccabe.get_code_complexity(code, complexity)
    return warnings
コード例 #7
0
def check_code(code, complexity=-1):
    warnings = pyflakes.check(code, '<stdin>')
    if complexity > -1:
        warnings += mccabe.get_code_complexity(code, complexity)
    return warnings
コード例 #8
0
ファイル: run.py プロジェクト: pombredanne/toppatch
def check_code(code, ignore=(), complexity=-1):
    warnings = pyflakes.check(code, ignore, "stdin")
    warnings += pep8style.input_file(None, lines=code.split("\n"))
    if complexity > -1:
        warnings += mccabe.get_code_complexity(code, complexity)
    return warnings
コード例 #9
0
 def test_import_exception_in_scope(self):
     self.assertEqual(check(code_import_exception), 0)
コード例 #10
0
 def test_exception(self):
     for c in (code, code2, code3):
         warnings = check(code)
         self.assertEqual(warnings, 0, code)