Anton Shestakov <av6@dwimlabs.net>, Sun, 15 Oct 2017 09:55:04 +0800
linters: add shellcheck (installed from repos), it's useful in some cases
--- a/dockerfiles/ubuntu-xenial Mon Oct 09 21:26:13 2017 +0800
+++ b/dockerfiles/ubuntu-xenial Sun Oct 15 09:55:04 2017 +0800
&& rm -rf /var/lib/apt/lists/*
RUN useradd worker --create-home --user-group
--- a/incoming.py Mon Oct 09 21:26:13 2017 +0800
+++ b/incoming.py Sun Oct 15 09:55:04 2017 +0800
(r'.* \((E\d{3})\)$', 'error'),
(r'.* \((W\d{3})\)$', 'warning'),
+ (r'^(?:warning|note): .* \[(SC\d{4})\]$', 'warning'),
+ (r'^error: .* \[(SC\d{4})\]$', 'error'),
for regex, cls in patterns:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/linters/shellcheck.yml Sun Oct 15 09:55:04 2017 +0800
+flags: ['--format', 'gcc']
--- a/tests/test_incoming.py Mon Oct 09 21:26:13 2017 +0800
+++ b/tests/test_incoming.py Sun Oct 15 09:55:04 2017 +0800
assert extra['link_start'] == 0
assert extra['link_end'] == 17
+ errors, warnings, extra = mlo('helper.sh:121:5: note: hello. [SC1234]')
+ assert set(extra) == usual_keys | {'code'}
+ assert extra['cls'] == 'warning'
+ assert extra['code'] == 'SC1234'
+ assert extra['filename'] == 'helper.sh'
+ assert extra['line_number'] == 121
+ assert extra['link_start'] == 0
+ assert extra['link_end'] == 13
errors, warnings, extra = mlo('requirements.txt:5:1: PIL is obsolete.')