mirror of
https://github.com/dense-analysis/ale.git
synced 2026-08-31 20:06:56 +08:00
Only run actionlint on github workflow files (#5154)
* Add test to fail on dependabot.yml * Run only on .github/workflows
This commit is contained in:
@@ -5,8 +5,8 @@ call ale#Set('yaml_actionlint_executable', 'actionlint')
|
|||||||
call ale#Set('yaml_actionlint_options', '')
|
call ale#Set('yaml_actionlint_options', '')
|
||||||
|
|
||||||
function! ale_linters#yaml#actionlint#GetCommand(buffer) abort
|
function! ale_linters#yaml#actionlint#GetCommand(buffer) abort
|
||||||
" Only execute actionlint on YAML files in /.github/ paths.
|
" Only execute actionlint on YAML files in /.github/workflows/ paths.
|
||||||
if expand('#' . a:buffer . ':p') !~# '\v[/\\]\.github[/\\]'
|
if expand('#' . a:buffer . ':p') !~# '\v[/\\]\.github[/\\]workflows[/\\]'
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
Before:
|
Before:
|
||||||
call ale#assert#SetUpLinterTest('yaml', 'actionlint')
|
call ale#assert#SetUpLinterTest('yaml', 'actionlint')
|
||||||
call ale#test#SetFilename('/.github/file.yml')
|
call ale#test#SetFilename('/.github/workflows/file.yml')
|
||||||
|
|
||||||
After:
|
After:
|
||||||
call ale#assert#TearDownLinterTest()
|
call ale#assert#TearDownLinterTest()
|
||||||
@@ -18,3 +18,8 @@ Execute(Options should be added to command):
|
|||||||
|
|
||||||
Execute(actionlint not run on files outside of /.github/ paths):
|
Execute(actionlint not run on files outside of /.github/ paths):
|
||||||
call ale#test#SetFilename('/something-else/file.yml')
|
call ale#test#SetFilename('/something-else/file.yml')
|
||||||
|
|
||||||
|
Execute(actionlint not run on Dependabot configuration files):
|
||||||
|
call ale#test#SetFilename('/.github/dependabot.yml')
|
||||||
|
|
||||||
|
AssertLinterNotExecuted
|
||||||
|
|||||||
Reference in New Issue
Block a user