All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 Save b:ale_warn_about_trailing_whitespace
4 runtime ale_linters/ansible/ansible_lint.vim
5 call ale#test#SetFilename('test_playbook.yml')
7 let b:ale_warn_about_trailing_whitespace = 1
12 call ale#linter#Reset()
14 Execute(The ansible-lint handler for version group <5 should handle basic errors):
21 \ 'text': 'Trailing whitespace',
22 \ 'code': 'EANSIBLE0002',
25 \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [4, 1, 2], [
26 \ fnamemodify(tempname(), ':h') . '/test_playbook.yml:35: [EANSIBLE0002] Trailing whitespace',
29 Execute(The ansible-lint handler for version group <5 should suppress trailing whitespace output when the option is used):
30 let b:ale_warn_about_trailing_whitespace = 0
35 \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [4, 1, 2], [
36 \ fnamemodify(tempname(), ':h') . '/test_playbook.yml:35: [EANSIBLE0002] Trailing whitespace',
40 Execute(The ansible-lint handler for version group >=5 should handle basic errors):
47 \ 'text': 'File permissions unset or incorrect',
48 \ 'code': 'risky-file-permissions',
51 \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [5, 1, 2], [
52 \ fnamemodify(tempname(), ':h') . '/test_playbook.yml:35: [risky-file-permissions] [VERY_HIGH] File permissions unset or incorrect',
56 runtime ale_linters/ansible/ansible_lint.vim
57 call ale#test#SetFilename('test playbook.yml')
60 call ale#linter#Reset()
62 Execute (The ansible-lint handler for version group <5 should handle names with spaces):
69 \ 'text': 'indentation is not a multiple of four',
73 \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [4, 1, 2], [
74 \ fnamemodify(tempname(), ':h') . '/test playbook.yml:6:6: E111 indentation is not a multiple of four',
77 Execute (The ansible-lint handler for version group >=5 should handle names with spaces):
84 \ 'text': "'var' is not a valid attribute for a Play",
85 \ 'code': 'syntax-check',
88 \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [5, 1, 2], [
89 \ fnamemodify(tempname(), ':h') . "/test playbook.yml:3:148: [syntax-check] [VERY_HIGH] 'var' is not a valid attribute for a Play",
92 Execute (The ansible-lint handler should work with issues with positions and lines members):
100 \ 'text': "syntax-check[specific]",
101 \ 'detail': 'fakedesc',
108 \ 'text': 'fqcn[action-core]',
109 \ 'detail': 'fakedesc2'
112 \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [6, 11, 0], [
115 \ ' "type": "issue",',
116 \ ' "check_name": "syntax-check[specific]",',
117 \ ' "categories": [',
121 \ ' "url": "https://ansible-lint.readthedocs.io/rules/syntax-check/",',
122 \ ' "severity": "major",',
123 \ ' "description": "fakedesc",',
124 \ ' "fingerprint": "4",',
126 \ ' "path": "test playbook.yml",',
136 \ ' "type": "issue",',
137 \ ' "check_name": "fqcn[action-core]",',
138 \ ' "categories": [',
141 \ ' "url": "https://ansible-lint.readthedocs.io/rules/fqcn/",',
142 \ ' "severity": "major",',
143 \ ' "description": "fakedesc2",',
144 \ ' "fingerprint": "f",',
146 \ ' "path": "test playbook.yml",',
152 \ ' "body": "Use `ansible.builtin.command` or `ansible.legacy.command` instead."',
158 Execute (The ansible-lint handler should ignore errors from other files):
162 \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [5, 1, 2], [
163 \ '/foo/bar/roles/test_playbook.yml:6: [command-instead-of-module] [VERY_LOW] curl used in place of get_url or uri module',
166 Execute (The ansible-lint handler should work with empty input):
170 \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [6, 0, 0], [])