All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 call ale#assert#SetUpLinterTest('python', 'bandit')
3 let b:bandit_flags = ' --format custom '
4 \ . '--msg-template "{line}:{test_id}:{severity}:{msg}" '
7 call ale#assert#TearDownLinterTest()
10 Execute(The bandit command callback should return default string):
11 AssertLinter 'bandit',
12 \ ale#Escape('bandit')
16 Execute(The bandit command callback should allow options):
17 let g:ale_python_bandit_options = '--configfile bandit.yaml'
19 AssertLinter 'bandit',
20 \ ale#Escape('bandit')
22 \ . ' --configfile bandit.yaml -'
24 Execute(The bandit executable should be configurable):
25 let g:ale_python_bandit_executable = '~/.local/bin/bandit'
27 AssertLinter '~/.local/bin/bandit',
28 \ ale#Escape('~/.local/bin/bandit')
32 Execute(Setting executable to 'pipenv' appends 'run bandit'):
33 let g:ale_python_bandit_executable = 'path/to/pipenv'
35 AssertLinter 'path/to/pipenv',
36 \ ale#Escape('path/to/pipenv')
41 Execute(Pipenv is detected when python_bandit_auto_pipenv is set):
42 let g:ale_python_bandit_auto_pipenv = 1
43 call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
45 AssertLinter 'pipenv',
46 \ ale#Escape('pipenv')
51 Execute(Setting executable to 'poetry' appends 'run bandit'):
52 let g:ale_python_bandit_executable = 'path/to/poetry'
54 AssertLinter 'path/to/poetry',
55 \ ale#Escape('path/to/poetry')
60 Execute(Poetry is detected when python_bandit_auto_poetry is set):
61 let g:ale_python_bandit_auto_poetry = 1
62 call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
64 AssertLinter 'poetry',
65 \ ale#Escape('poetry')
70 Execute(uv is used when python_bandit_auto_uv is set):
71 let g:ale_python_bandit_auto_uv = 1
72 call ale#test#SetFilename('../test-files/python/uv/whatever.py')
80 Execute(The bandit command callback should add .bandit by default):
81 silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_bandit/namespace/foo/bar.py')
83 let b:config_path = ale#path#Simplify(
84 \ g:dir . '/../test-files/python/with_bandit/.bandit'
87 AssertLinter 'bandit',
88 \ ale#Escape('bandit')
89 \ . ' --ini ' . ale#Escape(b:config_path)
93 Execute(The bandit command callback should support not using .bandit):
94 silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_bandit/subdir/foo/bar.py')
95 let g:ale_python_bandit_use_config = 0
97 AssertLinter 'bandit',
98 \ ale#Escape('bandit')