mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-31 00:24:31 +08:00
44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
Before:
|
|
let g:ale_bazel_buildifier_options = ''
|
|
call ale#assert#SetUpFixerTest('bzl', 'buildifier')
|
|
|
|
After:
|
|
call ale#assert#TearDownFixerTest()
|
|
|
|
Execute(The buildifier callback should return the correct default values):
|
|
call ale#test#SetFilename('../test-files/bazel/WORKSPACE')
|
|
|
|
AssertFixer
|
|
\ {
|
|
\ 'command': ale#Escape(g:ale_bazel_buildifier_executable)
|
|
\ . ' -mode fix -lint fix -type workspace -'
|
|
\ }
|
|
|
|
Execute(The buildifier callback should include any additional options):
|
|
call ale#test#SetFilename('../test-files/bazel/WORKSPACE')
|
|
let g:ale_bazel_buildifier_options = '--some-option'
|
|
|
|
AssertFixer
|
|
\ {
|
|
\ 'command': ale#Escape(g:ale_bazel_buildifier_executable)
|
|
\ . ' -mode fix -lint fix -type workspace --some-option -',
|
|
\ }
|
|
|
|
Execute(The buildifier callback should recognize BUILD files):
|
|
call ale#test#SetFilename('../test-files/bazel/BUILD')
|
|
|
|
AssertFixer
|
|
\ {
|
|
\ 'command': ale#Escape(g:ale_bazel_buildifier_executable)
|
|
\ . ' -mode fix -lint fix -type build -'
|
|
\ }
|
|
|
|
Execute(The buildifier callback should recognize .bzl files):
|
|
call ale#test#SetFilename('../test-files/bazel/defs.bzl')
|
|
|
|
AssertFixer
|
|
\ {
|
|
\ 'command': ale#Escape(g:ale_bazel_buildifier_executable)
|
|
\ . ' -mode fix -lint fix -type bzl -'
|
|
\ }
|