2022-05-03 01:03:05 +00:00
|
|
|
Before:
|
2024-01-14 11:51:39 +00:00
|
|
|
call ale#assert#SetUpLinterTest('yaml', 'actionlint')
|
2022-05-03 01:03:05 +00:00
|
|
|
|
|
|
|
After:
|
2024-01-14 11:51:39 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2022-05-03 01:03:05 +00:00
|
|
|
|
|
|
|
Execute(Problems should be parsed correctly for actionlint):
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 2,
|
|
|
|
\ 'col': 1,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': '"jobs" section is missing in workflow',
|
|
|
|
\ 'code': 'syntax-check',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 56,
|
|
|
|
\ 'col': 23,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': '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}',
|
|
|
|
\ 'code': 'expression',
|
|
|
|
\ },
|
|
|
|
\ ],
|
2023-09-05 13:33:41 +00:00
|
|
|
\ ale_linters#yaml#actionlint#Handle(bufnr(''), [
|
2022-05-03 01:03:05 +00:00
|
|
|
\ '.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]',
|
|
|
|
\ ])
|
2022-05-29 13:23:47 +00:00
|
|
|
|
2024-01-14 11:51:39 +00:00
|
|
|
Execute(Shellcheck issues should be reported at the line they appear):
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 19,
|
|
|
|
\ 'col': 9,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'Double quote to prevent globbing and word splitting',
|
|
|
|
\ 'code': 'shellcheck SC2086',
|
|
|
|
\ },
|
|
|
|
\ ],
|
|
|
|
\ ale_linters#yaml#actionlint#Handle(bufnr(''), [
|
|
|
|
\ 'validate.yml:19:9: shellcheck reported issue in this script: SC2086:info:1:15: Double quote to prevent globbing and word splitting [shellcheck]'
|
|
|
|
\ ])
|
|
|
|
|
2024-02-06 01:23:26 +00:00
|
|
|
Execute(Command should always have -no-color, -oneline and - options):
|
2022-05-29 13:23:47 +00:00
|
|
|
let g:ale_yaml_actionlint_options = ''
|
|
|
|
|
|
|
|
AssertEqual
|
2024-02-06 01:23:26 +00:00
|
|
|
\ '%e -no-color -oneline - ',
|
2023-09-05 13:33:41 +00:00
|
|
|
\ ale_linters#yaml#actionlint#GetCommand(bufnr(''))
|
2022-05-29 13:23:47 +00:00
|
|
|
|
|
|
|
Execute(Options should be added to command):
|
|
|
|
let g:ale_yaml_actionlint_options = '-shellcheck= -pyflakes='
|
|
|
|
|
|
|
|
AssertEqual
|
2024-02-06 01:23:26 +00:00
|
|
|
\ '%e -shellcheck= -pyflakes= -no-color -oneline - ',
|
2023-09-05 13:33:41 +00:00
|
|
|
\ ale_linters#yaml#actionlint#GetCommand(bufnr(''))
|