2017-10-25 18:46:16 +00:00
|
|
|
Before:
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#SetUpLinterTest('haml', 'hamllint')
|
2017-10-25 18:46:16 +00:00
|
|
|
|
|
|
|
let g:default_command = 'haml-lint %t'
|
|
|
|
|
|
|
|
After:
|
|
|
|
unlet! b:conf
|
2018-07-15 17:24:53 +00:00
|
|
|
unlet! b:conf_hamllint
|
|
|
|
unlet! b:conf_rubocop
|
2017-10-25 18:46:16 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2017-10-25 18:46:16 +00:00
|
|
|
|
|
|
|
Execute(The default command should be correct):
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'haml-lint', 'haml-lint %t'
|
2017-10-25 18:46:16 +00:00
|
|
|
|
|
|
|
Execute(The command should have the .rubocop.yml prepended as an env var if one exists):
|
|
|
|
call ale#test#SetFilename('../hamllint-test-files/rubocop-yml/subdir/file.haml')
|
2017-12-19 18:23:09 +00:00
|
|
|
let b:conf = ale#path#Simplify(g:dir . '/../hamllint-test-files/rubocop-yml/.rubocop.yml')
|
2017-10-25 18:46:16 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'haml-lint',
|
|
|
|
\ ale#Env('HAML_LINT_RUBOCOP_CONF', b:conf) . 'haml-lint %t'
|
2017-10-25 18:46:16 +00:00
|
|
|
|
|
|
|
Execute(The command should have the nearest .haml-lint.yml set as --config if it exists):
|
|
|
|
call ale#test#SetFilename('../hamllint-test-files/haml-lint-yml/subdir/file.haml')
|
2017-12-19 18:23:09 +00:00
|
|
|
let b:conf = ale#path#Simplify(g:dir . '/../hamllint-test-files/haml-lint-yml/.haml-lint.yml')
|
2017-10-25 18:46:16 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'haml-lint',
|
|
|
|
\ 'haml-lint --config ' . ale#Escape(b:conf) . ' %t',
|
2017-10-25 18:46:16 +00:00
|
|
|
|
|
|
|
Execute(The command should include a .rubocop.yml and a .haml-lint if both are found):
|
|
|
|
call ale#test#SetFilename('../hamllint-test-files/haml-lint-and-rubocop/subdir/file.haml')
|
2017-12-19 18:23:09 +00:00
|
|
|
let b:conf_hamllint = ale#path#Simplify(g:dir . '/../hamllint-test-files/haml-lint-and-rubocop/.haml-lint.yml')
|
|
|
|
let b:conf_rubocop = ale#path#Simplify(g:dir . '/../hamllint-test-files/haml-lint-and-rubocop/.rubocop.yml')
|
2017-10-25 18:46:16 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'haml-lint',
|
|
|
|
\ ale#Env('HAML_LINT_RUBOCOP_CONF', b:conf_rubocop)
|
|
|
|
\ . 'haml-lint --config ' . ale#Escape(b:conf_hamllint) . ' %t'
|