Download:
child 315:b3c5f2cf42fb
parent 313:f06c71c163f4
314:a3c2e221cadf
Anton Shestakov <av6@dwimlabs.net>, Sun, 08 Oct 2017 10:00:32 +0800
incoming: yamllint also has codes, just not numeric

2 файлов изменено, 7 вставок(+), 5 удалений(-) [+]
incoming.py file | annotate | diff | comparison | revisions
tests/test_incoming.py file | annotate | diff | comparison | revisions
--- a/incoming.py Fri Oct 06 16:25:47 2017 +0800
+++ b/incoming.py Sun Oct 08 10:00:32 2017 +0800
@@ -46,8 +46,10 @@
# https://pep8.readthedocs.io/en/latest/intro.html#error-codes
(r'^E9\d{2}', 'error'),
(r'^[EWFCN]\d{3}', 'warning'),
- (r'^\[error\]', 'error'),
- (r'^\[warning\]', 'warning'),
+
+ # yamllint
+ (r'^\[error\] .* \(\S+\)$', 'error'),
+ (r'^\[warning\] .* \(\S+\)$', 'warning'),
# luacheck
(r'^\(E\d{3}\)', 'error'),
--- a/tests/test_incoming.py Fri Oct 06 16:25:47 2017 +0800
+++ b/tests/test_incoming.py Sun Oct 08 10:00:32 2017 +0800
@@ -15,15 +15,15 @@
assert extra['link_start'] == 0
assert extra['link_end'] == 11
- errors, warnings, extra = mlo('file with spaces:007:001: [error] oops!')
+ errors, warnings, extra = mlo('s p a c e.yml:07:01: [error] oops! (uh-oh)')
assert errors == 1
assert warnings == 0
assert sorted(extra.keys()) == usual_keys
assert extra['cls'] == 'error'
- assert extra['filename'] == 'file with spaces'
+ assert extra['filename'] == 's p a c e.yml'
assert extra['line_number'] == 7
assert extra['link_start'] == 0
- assert extra['link_end'] == 20
+ assert extra['link_end'] == 16
errors, warnings, extra = mlo('requirements.txt:1:1: PIL is obsolete.')
assert errors == 0