diff options
author | Horacio Sanson <hsanson@gmail.com> | 2021-01-05 12:45:36 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-05 12:45:36 +0900 |
commit | 7e4c125d38181a0e0d0c7883091e2fe683243ce4 (patch) | |
tree | 52f6287cd167ce757dc71b2448e41bbe47b78046 /test | |
parent | 8c34c738aba4ef2ff033b693037eec343f629b0e (diff) | |
parent | e358afdd9ba5108680afc6aa017075b44f6c18fa (diff) | |
download | ale-7e4c125d38181a0e0d0c7883091e2fe683243ce4.zip |
Merge pull request #3491 from Poulpatine/salt-lint
Add salt-lint support
Diffstat (limited to 'test')
-rw-r--r-- | test/handler/test_salt_salt_lint.vader | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/handler/test_salt_salt_lint.vader b/test/handler/test_salt_salt_lint.vader new file mode 100644 index 00000000..7e234785 --- /dev/null +++ b/test/handler/test_salt_salt_lint.vader @@ -0,0 +1,34 @@ +Before: + runtime ale_linters/salt/salt_lint.vim + +After: + call ale#linter#Reset() + +Execute(The salt handler should parse lines correctly and show error in severity HIGH): + AssertEqual + \ [ + \ { + \ 'lnum': 5, + \ 'code': 207, + \ 'text': 'File modes should always be encapsulated in quotation marks', + \ 'type': 'E' + \ } + \ ], + \ ale_linters#salt#salt_lint#Handle(255, [ + \ '[{"id": "207", "message": "File modes should always be encapsulated in quotation marks", "filename": "test.sls", "linenumber": 5, "line": " - mode: 0755", "severity": "HIGH"}]' + \ ]) + + +Execute(The salt handler should parse lines correctly and show error in severity not HIGH): + AssertEqual + \ [ + \ { + \ 'lnum': 27, + \ 'code': 204, + \ 'text': 'Lines should be no longer that 160 chars', + \ 'type': 'W' + \ } + \ ], + \ ale_linters#salt#salt_lint#Handle(255, [ + \ '[{"id": "204", "message": "Lines should be no longer that 160 chars", "filename": "test2.sls", "linenumber": 27, "line": "this line is definitely longer than 160 chars, this line is definitely longer than 160 chars, this line is definitely longer than 160 chars", "severity": "VERY_LOW"}]' + \ ]) |