forked from dense-analysis/ale
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run actionlint by default on GitHub files
Detect paths containing .github as a directory for running actionlint by default on YAML filetypes.
- Loading branch information
Showing
7 changed files
with
61 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Before: | ||
runtime ale_linters/yaml/actionlint.vim | ||
|
||
After: | ||
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(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]' | ||
\ ]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,20 @@ | ||
Before: | ||
call ale#assert#SetUpLinterTest('yaml', 'actionlint') | ||
call ale#test#SetFilename('/.github/file.yml') | ||
|
||
After: | ||
call ale#assert#TearDownLinterTest() | ||
|
||
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(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]' | ||
\ ]) | ||
|
||
Execute(Command should always have -no-color, -oneline and - options): | ||
let g:ale_yaml_actionlint_options = '' | ||
|
||
AssertEqual | ||
\ '%e -no-color -oneline - ', | ||
\ ale_linters#yaml#actionlint#GetCommand(bufnr('')) | ||
AssertLinter 'actionlint', ale#Escape('actionlint') . ' -no-color -oneline - ' | ||
|
||
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('')) | ||
AssertLinter 'actionlint', | ||
\ ale#Escape('actionlint') . ' -shellcheck= -pyflakes= -no-color -oneline - ' | ||
|
||
Execute(actionlint not run on files outside of /.github/ paths): | ||
call ale#test#SetFilename('/something-else/file.yml') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters