]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/linter/test_haml_hamllint.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

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.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '56df844d3c39ec494dacc69eae34272b27db185a' as '.vim/bundle/asyncomplete'
[etc/vim.git] / .vim / bundle / ale / test / linter / test_haml_hamllint.vader
1 Before:
2   call ale#assert#SetUpLinterTest('haml', 'hamllint')
3
4   let g:default_command = 'haml-lint %t'
5
6 After:
7   unlet! b:conf
8   unlet! b:conf_hamllint
9   unlet! b:conf_rubocop
10
11   call ale#assert#TearDownLinterTest()
12
13 Execute(The default command should be correct):
14   AssertLinter 'haml-lint', 'haml-lint %t'
15
16 Execute(The command should have the .rubocop.yml prepended as an env var if one exists):
17   call ale#test#SetFilename('../test-files/hamllint/rubocop-yml/subdir/file.haml')
18   let b:conf = ale#path#Simplify(g:dir . '/../test-files/hamllint/rubocop-yml/.rubocop.yml')
19
20   AssertLinter 'haml-lint',
21   \ ale#Env('HAML_LINT_RUBOCOP_CONF', b:conf) .  'haml-lint %t'
22
23 Execute(The command should have the nearest .haml-lint.yml set as --config if it exists):
24   call ale#test#SetFilename('../test-files/hamllint/haml-lint-yml/subdir/file.haml')
25   let b:conf = ale#path#Simplify(g:dir . '/../test-files/hamllint/haml-lint-yml/.haml-lint.yml')
26
27   AssertLinter 'haml-lint',
28   \ 'haml-lint --config ' . ale#Escape(b:conf) . ' %t',
29
30 Execute(The command should include a .rubocop.yml and a .haml-lint if both are found):
31   call ale#test#SetFilename('../test-files/hamllint/haml-lint-and-rubocop/subdir/file.haml')
32   let b:conf_hamllint = ale#path#Simplify(g:dir . '/../test-files/hamllint/haml-lint-and-rubocop/.haml-lint.yml')
33   let b:conf_rubocop = ale#path#Simplify(g:dir . '/../test-files/hamllint/haml-lint-and-rubocop/.rubocop.yml')
34
35   AssertLinter 'haml-lint',
36   \ ale#Env('HAML_LINT_RUBOCOP_CONF', b:conf_rubocop)
37   \   .  'haml-lint --config ' . ale#Escape(b:conf_hamllint) .  ' %t'
38
39 Execute(The executable can be overridden):
40   let b:ale_haml_hamllint_executable = 'bin/haml-lint'
41   call ale#test#SetFilename('../test-files/dummy')
42
43   AssertLinter 'bin/haml-lint', 'bin/haml-lint %t'