summaryrefslogtreecommitdiff
path: root/test/handler/test_shellcheck_handler.vader
blob: 33f129890142ae665ade6a38f59cf35974749662 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Before:
  runtime ale_linters/shell/shellcheck.vim

After:
  call ale#linter#Reset()

Execute(The shellcheck handler should handle basic errors or warnings):
  AssertEqual
  \ [
  \   {
  \     'lnum': 2,
  \     'col': 1,
  \     'type': 'W',
  \     'text': 'In POSIX sh, ''let'' is not supported.',
  \     'code': 'SC2039',
  \   },
  \   {
  \     'lnum': 2,
  \     'col': 3,
  \     'type': 'E',
  \     'text': 'Don''t put spaces around the = in assignments.',
  \     'code': 'SC1068',
  \   },
  \ ],
  \ ale#handlers#shellcheck#Handle(bufnr(''), [
  \   '-:2:1: warning: In POSIX sh, ''let'' is not supported. [SC2039]',
  \   '-:2:3: error: Don''t put spaces around the = in assignments. [SC1068]',
  \ ])

Execute(The shellcheck handler should handle notes):
  AssertEqual
  \ [
  \   {
  \     'lnum': 3,
  \     'col': 3,
  \     'type': 'I',
  \     'text': 'Double quote to prevent globbing and word splitting.',
  \     'code': 'SC2086',
  \   },
  \ ],
  \ ale#handlers#shellcheck#Handle(bufnr(''), [
  \   '-:3:3: note: Double quote to prevent globbing and word splitting. [SC2086]',
  \ ])