MCPcopy Create free account
hub / github.com/dmlc/dmlc-core / process_python

Method process_python

scripts/lint.py:86–103  ·  view source on GitHub ↗

Process a python file.

(self, path)

Source from the content-addressed store, hash-verified

84 self.cpp_src_map[str(path)] = errors
85
86 def process_python(self, path):
87 """Process a python file."""
88 (pylint_stdout, pylint_stderr) = epylint.py_run(
89 ' '.join([str(path)] + self.pylint_opts), return_std=True)
90 emap = {}
91 err = pylint_stderr.read()
92 if len(err):
93 print(err)
94 for line in pylint_stdout:
95 sys.stderr.write(line)
96 key = line.split(':')[-1].split('(')[0].strip()
97 if key not in self.pylint_cats:
98 continue
99 if key not in emap:
100 emap[key] = 1
101 else:
102 emap[key] += 1
103 self.python_map[str(path)] = emap
104
105 def print_summary(self, strm):
106 """Print summary of lint."""

Callers 1

processFunction · 0.80

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected