Download:
child 15:fa08a5f4efd3
parent 13:448ea1a0274c
14:9cebce155650
Anton Shestakov <av6@dwimlabs.net>, Tue, 14 Jun 2016 13:51:47 +0800
checker: parse warnings and errors (hardcoded for now)

2 файлов изменено, 34 вставок(+), 0 удалений(-) [+]
checker.py file | annotate | diff | comparison | revisions
incoming.py file | annotate | diff | comparison | revisions
--- a/checker.py Tue Jun 14 13:37:38 2016 +0800
+++ b/checker.py Tue Jun 14 13:51:47 2016 +0800
@@ -105,6 +105,13 @@
ok = False
break
+ for f in files.splitlines():
+ if 'pip' in linter:
+ cmd = [os.path.join(venv, 'bin', linter['cmd'])]
+ if not run(cmd + linter.get('flags', []) + [f], ignore_1=True):
+ ok = False
+ break
+
print('# C&O task: cleanup')
rmtree(tmp)
--- a/incoming.py Tue Jun 14 13:37:38 2016 +0800
+++ b/incoming.py Tue Jun 14 13:51:47 2016 +0800
@@ -23,6 +23,7 @@
meta_prefix = '# C&O '
+ state = 'not even started'
result = []
errors = 0
warnings = 0
@@ -40,6 +41,31 @@
for line in lines:
cls = None
+ if state == 'checks':
+ # pep8-specific E9xx
+ # https://pep8.readthedocs.io/en/latest/intro.html#error-codes
+ if re.match(r'^.+:\d+:\d+: E9\d{2}', line) is not None:
+ errors += 1
+ cls = 'error'
+ elif re.match(r'^.+:\d+:\d+: [EWFCN]\d{3}', line) is not None:
+ warnings += 1
+ cls = 'warning'
+ elif re.match(r'^.+:\d+:\d+: \[error\]', line) is not None:
+ errors += 1
+ cls = 'error'
+ elif re.match(r'^.+:\d+:\d+: \[warning\]', line) is not None:
+ warnings += 1
+ cls = 'warning'
+ elif re.match(r'^.+:\d+:\d+: \(E\d{3}\)', line) is not None:
+ errors += 1
+ cls = 'error'
+ elif re.match(r'^.+:\d+:\d+: \(W\d{3}\)', line) is not None:
+ warnings += 1
+ cls = 'warning'
+ elif re.match(r'^.+:\d+:\d+: ', line) is not None:
+ warnings += 1
+ cls = 'warning'
+
if line.startswith(meta_prefix):
cls = 'meta'
@@ -47,6 +73,7 @@
m = re.match('^task: (\w+)$', rest)
if m is not None:
+ state = m.group(1)
cls = 'task'
m = re.match('^job failed$', rest)