summaryrefslogtreecommitdiff
path: root/test/test_filetype_linter_defaults.vader
blob: 7277ff005c53a8689d39c2b21c5b2bca784504b6 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
Before:
  Save g:ale_linters
  Save g:ale_linters_explicit

  let g:ale_linters_explicit = 0
  let g:ale_linters = {}

  function! GetLinterNames(filetype) abort
    return map(ale#linter#Get(a:filetype), 'v:val.name')
  endfunction

After:
  Restore

  call ale#linter#Reset()

Execute(The defaults for the apkbuild filetype should be correct):
  AssertEqual ['apkbuild_lint', 'secfixes_check'], GetLinterNames('apkbuild')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('apkbuild')

Execute(The defaults for the csh filetype should be correct):
  AssertEqual ['shell'], GetLinterNames('csh')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('csh')

Execute(The defaults for the elixir filetype should be correct):
  AssertEqual ['credo', 'dialyxir', 'dogma'], GetLinterNames('elixir')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('elixir')

Execute(The defaults for the go filetype should be correct):
  AssertEqual ['gofmt', 'golint', 'gopls', 'govet'], GetLinterNames('go')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('go')

Execute(The defaults for the hack filetype should be correct):
  AssertEqual ['hack'], GetLinterNames('hack')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('hack')

Execute(The defaults for the help filetype should be correct):
  AssertEqual [], GetLinterNames('help')

Execute(The defaults for the inko filetype should be correct):
  AssertEqual ['inko'], GetLinterNames('inko')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('inko')

Execute(The defaults for the json filetype should be correct):
  AssertEqual ['jsonlint', 'spectral'], GetLinterNames('json')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('json')

Execute(The defaults for the json5 filetype should be correct):
  AssertEqual [], GetLinterNames('json5')

Execute(The defaults for the jsonc filetype should be correct):
  AssertEqual [], GetLinterNames('jsonc')

Execute(The defaults for the perl filetype should be correct):
  AssertEqual ['perlcritic'], GetLinterNames('perl')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('perl')

Execute(The defaults for the perl6 filetype should be correct):
  AssertEqual [], GetLinterNames('perl6')

Execute(The defaults for the python filetype should be correct):
  AssertEqual ['flake8', 'mypy', 'pylint', 'pyright'], GetLinterNames('python')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('python')

Execute(The defaults for the rust filetype should be correct):
  AssertEqual ['cargo', 'rls'], GetLinterNames('rust')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('rust')

Execute(The defaults for the spec filetype should be correct):
  AssertEqual [], GetLinterNames('spec')

Execute(The defaults for the text filetype should be correct):
  AssertEqual [], GetLinterNames('text')

Execute(The defaults for the vue filetype should be correct):
  AssertEqual ['vls', 'eslint'], GetLinterNames('vue')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('vue')

Execute(The defaults for the zsh filetype should be correct):
  AssertEqual ['shell'], GetLinterNames('zsh')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('zsh')

Execute(The defaults for the verilog filetype should be correct):
  " This filetype isn't configured with default, so we can test loading all
  " available linters with this.
  AssertEqual ['hdl-checker', 'iverilog', 'verilator', 'vlog', 'xvlog', 'yosys'], GetLinterNames('verilog')

  let g:ale_linters_explicit = 1

  AssertEqual [], GetLinterNames('verilog')

Execute(Default aliases for React should be defined):
  AssertEqual ['javascript', 'jsx'], ale#linter#ResolveFiletype('javascriptreact')
  AssertEqual ['typescript', 'tsx'], ale#linter#ResolveFiletype('typescriptreact')