Download:
child 44:1c2db26fa4bd
parent 42:06c224e8b052
43:2e6ba4861557
Anton Shestakov <av6@dwimlabs.net>, Sun, 19 Jun 2016 14:16:56 +0800
incoming: only try to match linter output if it's not a meta line

1 файлов изменено, 29 вставок(+), 29 удалений(-) [+]
incoming.py file | annotate | diff | comparison | revisions
--- a/incoming.py Sun Jun 19 14:07:11 2016 +0800
+++ b/incoming.py Sun Jun 19 14:16:56 2016 +0800
@@ -43,35 +43,6 @@
for line in lines:
cls = None
- if state == 'checks':
- m = re.match(r'^(.+):(\d+):\d+: ', line)
- if m is not None:
- rest = line[m.end():]
-
- # pep8-specific E9xx
- # https://pep8.readthedocs.io/en/latest/intro.html#error-codes
- if re.match(r'^E9\d{2}', rest) is not None:
- errors += 1
- cls = 'error'
- elif re.match(r'^[EWFCN]\d{3}', rest) is not None:
- warnings += 1
- cls = 'warning'
- elif re.match(r'^\[error\]', rest) is not None:
- errors += 1
- cls = 'error'
- elif re.match(r'^\[warning\]', rest) is not None:
- warnings += 1
- cls = 'warning'
- elif re.match(r'^\(E\d{3}\)', rest) is not None:
- errors += 1
- cls = 'error'
- elif re.match(r'^\(W\d{3}\)', rest) is not None:
- warnings += 1
- cls = 'warning'
- else:
- warnings += 1
- cls = 'warning'
-
if line.startswith(meta_prefix):
cls = 'meta'
@@ -115,6 +86,35 @@
if m is not None:
message = m.group(1)
+ elif state == 'checks':
+ m = re.match(r'^(.+):(\d+):\d+: ', line)
+ if m is not None:
+ rest = line[m.end():]
+
+ # pep8-specific E9xx
+ # https://pep8.readthedocs.io/en/latest/intro.html#error-codes
+ if re.match(r'^E9\d{2}', rest) is not None:
+ errors += 1
+ cls = 'error'
+ elif re.match(r'^[EWFCN]\d{3}', rest) is not None:
+ warnings += 1
+ cls = 'warning'
+ elif re.match(r'^\[error\]', rest) is not None:
+ errors += 1
+ cls = 'error'
+ elif re.match(r'^\[warning\]', rest) is not None:
+ warnings += 1
+ cls = 'warning'
+ elif re.match(r'^\(E\d{3}\)', rest) is not None:
+ errors += 1
+ cls = 'error'
+ elif re.match(r'^\(W\d{3}\)', rest) is not None:
+ warnings += 1
+ cls = 'warning'
+ else:
+ warnings += 1
+ cls = 'warning'
+
result.append((cls, line))
parsed = urlparse(url)