--- a/incoming.py Fri Oct 06 16:25:47 2017 +0800
+++ b/incoming.py Sun Oct 08 10:00:32 2017 +0800
# https://pep8.readthedocs.io/en/latest/intro.html#error-codes
(r'^[EWFCN]\d{3}', 'warning'),
- (r'^\[error\]', 'error'),
- (r'^\[warning\]', 'warning'),
+ (r'^\[error\] .* \(\S+\)$', 'error'),
+ (r'^\[warning\] .* \(\S+\)$', 'warning'),
(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
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 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.')