File: test_terraform_tfsec.vader

package info (click to toggle)
vim-ale 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,764 kB
  • sloc: sh: 499; python: 311; perl: 31; makefile: 4; xml: 4; javascript: 1
file content (38 lines) | stat: -rw-r--r-- 1,330 bytes parent folder | download | duplicates (2)
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
Before:
  call ale#assert#SetUpLinterTest('terraform', 'tfsec')

After:
  call ale#assert#TearDownLinterTest()

Execute(The default command should be correct):
  AssertLinter 'tfsec', ale#Escape('tfsec') . ' --format json'

Execute(The default executable should be configurable):
  let b:ale_terraform_tfsec_executable = '/usr/bin/tfsec'

  AssertLinter '/usr/bin/tfsec', ale#Escape('/usr/bin/tfsec') . ' --format json'

Execute(Overriding options should work):
  let g:ale_terraform_tfsec_executable = '/usr/local/bin/tfsec'
  let g:ale_terraform_tfsec_options = '--minimum-severity MEDIUM'

  AssertLinter '/usr/local/bin/tfsec',
  \ ale#Escape('/usr/local/bin/tfsec') . ' --minimum-severity MEDIUM --format json'

Execute(Configuration yml file should be found):
  call ale#test#SetFilename('../test-files/tfsec/yml/main.tf')

  AssertLinter 'tfsec',
  \ ale#Escape('tfsec')
  \   . ' --config-file '
  \   . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/tfsec/yml/.tfsec/config.yml'))
  \   . ' --format json'

Execute(Configuration json file should be found):
  call ale#test#SetFilename('../test-files/tfsec/json/main.tf')

  AssertLinter 'tfsec',
  \ ale#Escape('tfsec')
  \   . ' --config-file '
  \   . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/tfsec/json/.tfsec/config.json'))
  \   . ' --format json'