mirror of
https://github.com/dense-analysis/ale
synced 2025-02-16 12:16:56 +00:00
Add support for actionlint options (#4216)
* Add support for actionlint options * fix misaligned doc tags
This commit is contained in:
parent
ae44f05600
commit
876140832c
@ -1,6 +1,7 @@
|
||||
" Author: bretello <bretello@distruzione.org>
|
||||
|
||||
call ale#Set('yaml_actionlint_executable', 'actionlint')
|
||||
call ale#Set('yaml_actionlint_options', '')
|
||||
|
||||
call ale#linter#Define('yaml', {
|
||||
\ 'name': 'actionlint',
|
||||
|
@ -1,5 +1,17 @@
|
||||
function! ale#handlers#actionlint#GetCommand(buffer) abort
|
||||
return '%e --no-color --oneline %t'
|
||||
let l:options = ale#Var(a:buffer, 'yaml_actionlint_options')
|
||||
|
||||
" automatically add --no-color option if not defined
|
||||
if l:options !~# '--no-color'
|
||||
let l:options .= ' --no-color'
|
||||
endif
|
||||
|
||||
" automatically add --oneline option if not defined
|
||||
if l:options !~# '--oneline'
|
||||
let l:options .= ' --oneline'
|
||||
endif
|
||||
|
||||
return '%e ' . l:options . ' %t'
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#actionlint#Handle(buffer, lines) abort
|
||||
|
@ -32,6 +32,20 @@ g:ale_yaml_actionlint_executable *g:ale_yaml_actionlint_executable*
|
||||
|
||||
This variable can be set to change the path to actionlint.
|
||||
|
||||
g:ale_yaml_actionlint_options *g:ale_yaml_actionlint_options*
|
||||
*b:ale_yaml_actionlint_options*
|
||||
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be set to add extra options to actionlint executable.
|
||||
|
||||
For example, to disable running `shellcheck` and `pyflakes` external commands,
|
||||
you may want to set:
|
||||
>
|
||||
let g:ale_yaml_actionlint_options = '-shellcheck= -pyflakes='
|
||||
<
|
||||
Please note that passing `-format` as option is not supported at the moment.
|
||||
|
||||
===============================================================================
|
||||
circleci *ale-yaml-circleci*
|
||||
|
@ -2,6 +2,7 @@ Before:
|
||||
runtime! ale/handlers/actionlint.vim
|
||||
|
||||
After:
|
||||
unlet! g:ale_yaml_actionlint_options
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(Problems should be parsed correctly for actionlint):
|
||||
@ -26,3 +27,17 @@ Execute(Problems should be parsed correctly for actionlint):
|
||||
\ '.codecov.yaml:2:1: "jobs" section is missing in workflow [syntax-check]',
|
||||
\ 'workflow_call_event.yaml:56:23: property "unknown_input" is not defined in object type {input7: bool; input0: any; input1: any; input2: string; input3: any; input4: any; input5: number; input6: number} [expression]',
|
||||
\ ])
|
||||
|
||||
Execute(Command should always have --no-color and --oneline options):
|
||||
let g:ale_yaml_actionlint_options = ''
|
||||
|
||||
AssertEqual
|
||||
\ '%e --no-color --oneline %t',
|
||||
\ ale#handlers#actionlint#GetCommand(bufnr(''))
|
||||
|
||||
Execute(Options should be added to command):
|
||||
let g:ale_yaml_actionlint_options = '-shellcheck= -pyflakes='
|
||||
|
||||
AssertEqual
|
||||
\ '%e -shellcheck= -pyflakes= --no-color --oneline %t',
|
||||
\ ale#handlers#actionlint#GetCommand(bufnr(''))
|
||||
|
Loading…
Reference in New Issue
Block a user