From 3bedafc29a45d478f41d8467a988e29c35618737 Mon Sep 17 00:00:00 2001 From: Peter Benjamin Date: Tue, 5 Sep 2023 06:33:41 -0700 Subject: fix(yaml): make actionlint respect config (#4584) * fix(yaml): make actionlint respect config * docs: update actionlint docs * chore: update author & add description * test: move actionlint test to test/linter/ --- test/handler/test_actionlint_handler.vader | 43 ------------------------------ test/linter/test_yaml_actionlint.vader | 43 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 43 deletions(-) delete mode 100644 test/handler/test_actionlint_handler.vader create mode 100644 test/linter/test_yaml_actionlint.vader (limited to 'test') diff --git a/test/handler/test_actionlint_handler.vader b/test/handler/test_actionlint_handler.vader deleted file mode 100644 index 3e762129..00000000 --- a/test/handler/test_actionlint_handler.vader +++ /dev/null @@ -1,43 +0,0 @@ -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): - 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', - \ }, - \ ], - \ ale#handlers#actionlint#Handle(bufnr(''), [ - \ '.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('')) diff --git a/test/linter/test_yaml_actionlint.vader b/test/linter/test_yaml_actionlint.vader new file mode 100644 index 00000000..82ab2f6d --- /dev/null +++ b/test/linter/test_yaml_actionlint.vader @@ -0,0 +1,43 @@ +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): + 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', + \ }, + \ ], + \ ale_linters#yaml#actionlint#Handle(bufnr(''), [ + \ '.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', + \ ale_linters#yaml#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', + \ ale_linters#yaml#actionlint#GetCommand(bufnr('')) -- cgit v1.2.3