summaryrefslogtreecommitdiff
path: root/test/handler/test_credo_handler.vader
blob: 1fd54bb523cecfbb2e3f354f95a27f5391495f05 (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
44
45
46
47
48
49
50
51
52
53
Before:
  runtime ale_linters/elixir/credo.vim

After:
  call ale#linter#Reset()

Execute(The credo handler should parse lines correctly):
  AssertEqual
  \ [
  \   {
  \     'bufnr': 347,
  \     'lnum': 1,
  \     'col': 24,
  \     'text': 'This code can be refactored',
  \     'type': 'W',
  \   },
  \   {
  \     'bufnr': 347,
  \     'lnum': 1,
  \     'col': 4,
  \     'text': 'There is no whitespace around parentheses/brackets most of the time, but here there is.',
  \     'type': 'W',
  \   },
  \   {
  \     'bufnr': 347,
  \     'lnum': 5,
  \     'col': 21,
  \     'text': 'TODO comment',
  \     'type': 'I',
  \   },
  \   {
  \     'bufnr': 347,
  \     'lnum': 26,
  \     'col': 0,
  \     'text': 'If/else blocks should not have a negated condition in `if`.',
  \     'type': 'I',
  \   },
  \   {
  \     'bufnr': 347,
  \     'lnum': 15,
  \     'col': 1,
  \     'text': 'Warning in the code',
  \     'type': 'W',
  \   },
  \ ],
  \ ale_linters#elixir#credo#Handle(347, [
  \   'This line should be ignored completely',
  \   'lib/my_code/test.ex:1:24: F: This code can be refactored',
  \   'lib/filename.ex:1:4: C: There is no whitespace around parentheses/brackets most of the time, but here there is.',
  \   'lib/my_code/test.ex:5:21: D: TODO comment',
  \   'lib/phoenix/channel.ex:26: R: If/else blocks should not have a negated condition in `if`.',
  \   'lib/my_code/test.ex:15:1: W: Warning in the code',
  \ ])