ale/test/linter/test_bicep_az_bicep.vader
Carl Smedstad 93100159a2
Add support for Bicep when installed as a plugin to Azure CLI (#4496)
* Add support for Bicep when installed as a plugin to Azure CLI

The compiler for Microsoft's DSL Bicep can be installed both
independently and as a plugin to Azure CLI. The latter is probably how
most people install it.

The program output is the same but Azure CLI wraps the arguments and has
a slightly different interface, hence I opted to copy the old linter and
modify it to match the plugin arguments.

* Fix bicep/az_bicep tests, arguments and parsing

* Actually test the ale_linters#bicep#az_bicep#Handle function in the
  test that should test that function, not
  ale_linters#bicep#bicep#Handle.

* Use the same method as in bicep/bicep for discarding output file, i.e.
  by specifying --outfile to a null file.

* Fix parsing of occasionally occurring leading error type (such as
  'ERROR: ').

* Correct option defaults for bicep & az_bicep specified in documentation
2023-04-13 08:51:52 +09:00

22 lines
688 B
Plaintext

Before:
call ale#assert#SetUpLinterTest('bicep', 'az_bicep')
After:
call ale#assert#TearDownLinterTest()
Execute(The default command should be correct):
if has('win32')
AssertLinter 'az', ale#Escape('az') . ' bicep build --outfile NUL --file %s '
else
AssertLinter 'az', ale#Escape('az') . ' bicep build --outfile /dev/null --file %s '
endif
Execute(The executable should be configurable):
let g:ale_bicep_az_bicep_executable = 'foobar'
if has('win32')
AssertLinter 'foobar', ale#Escape('foobar') . ' bicep build --outfile NUL --file %s '
else
AssertLinter 'foobar', ale#Escape('foobar') . ' bicep build --outfile /dev/null --file %s '
endif