MCPcopy Create free account
hub / github.com/PyCQA/pyflakes / checkPath

Function checkPath

pyflakes/api.py:54–71  ·  view source on GitHub ↗

Check the given path, printing out any warnings detected. @param reporter: A L{Reporter} instance, where errors and warnings will be reported. @return: the number of warnings printed

(filename, reporter=None)

Source from the content-addressed store, hash-verified

52
53
54def checkPath(filename, reporter=None):
55 """
56 Check the given path, printing out any warnings detected.
57
58 @param reporter: A L{Reporter} instance, where errors and warnings will be
59 reported.
60
61 @return: the number of warnings printed
62 """
63 if reporter is None:
64 reporter = modReporter._makeDefaultReporter()
65 try:
66 with open(filename, 'rb') as f:
67 codestr = f.read()
68 except OSError as e:
69 reporter.unexpectedError(filename, e.args[1])
70 return 1
71 return check(codestr, filename, reporter)
72
73
74def isPythonFile(filename):

Callers 2

getErrorsMethod · 0.90
checkRecursiveFunction · 0.85

Calls 2

checkFunction · 0.85
unexpectedErrorMethod · 0.45

Tested by 1

getErrorsMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…