Run actionlint by default on GitHub files

Detect paths containing .github as a directory for running actionlint
by default on YAML filetypes.
This commit is contained in:
w0rp
2024-06-02 19:07:06 +01:00
parent adaa7f6f62
commit c7c41e1574
7 changed files with 61 additions and 47 deletions

View File

@@ -5,6 +5,11 @@ call ale#Set('yaml_actionlint_executable', 'actionlint')
call ale#Set('yaml_actionlint_options', '')
function! ale_linters#yaml#actionlint#GetCommand(buffer) abort
" Only execute actionlint on YAML files in /.github/ paths.
if expand('#' . a:buffer . ':p') !~# '\v[/\\]\.github[/\\]'
return ''
endif
let l:options = ale#Var(a:buffer, 'yaml_actionlint_options')
if l:options !~# '-no-color'