install.fairie/dotfiles/.vim/plugged/ale/test/linter/test_html_stylelint.vader
Git E2E Dev Test Username e149692cc9 git subrepo clone https://github.com/dense-analysis/ale.git ./dotfiles/.vim/plugged/ale
subrepo:
  subdir:   "dotfiles/.vim/plugged/ale"
  merged:   "e4b205440"
upstream:
  origin:   "https://github.com/dense-analysis/ale.git"
  branch:   "master"
  commit:   "e4b205440"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:09 -04:00

60 lines
1.8 KiB
Text

Before:
Save g:ale_html_stylelint_executable
Save g:ale_html_stylelint_use_global
Save g:ale_html_stylelint_options
unlet! b:executable
unlet! g:ale_html_stylelint_executable
unlet! g:ale_html_stylelint_use_global
unlet! g:ale_html_stylelint_options
call ale#test#SetDirectory('/testplugin/test/linter')
call ale#test#SetFilename('testfile.html')
runtime ale_linters/html/stylelint.vim
After:
Restore
unlet! b:executable
unlet! b:ale_html_stylelint_executable
unlet! b:ale_html_stylelint_use_global
unlet! b:ale_html_stylelint_options
call ale#test#SetFilename('test.txt')
call ale#test#RestoreDirectory()
call ale#linter#Reset()
Execute(node_modules directories should be discovered):
call ale#test#SetFilename('../test-files/stylelint/nested/testfile.html')
let b:executable = ale#path#Simplify(
\ g:dir
\ . '/../test-files/stylelint/node_modules/.bin/stylelint'
\)
AssertEqual b:executable, ale_linters#html#stylelint#GetExecutable(bufnr(''))
AssertEqual
\ ale#Escape(b:executable) . ' --stdin-filename %s',
\ ale_linters#html#stylelint#GetCommand(bufnr(''))
Execute(The global override should work):
let b:ale_html_stylelint_executable = 'foobar'
let b:ale_html_stylelint_use_global = 1
call ale#test#SetFilename('../test-files/stylelint/nested/testfile.html')
AssertEqual 'foobar', ale_linters#html#stylelint#GetExecutable(bufnr(''))
AssertEqual
\ ale#Escape('foobar') . ' --stdin-filename %s',
\ ale_linters#html#stylelint#GetCommand(bufnr(''))
Execute(Extra options should be configurable):
let b:ale_html_stylelint_options = '--whatever'
AssertEqual 'stylelint', ale_linters#html#stylelint#GetExecutable(bufnr(''))
AssertEqual
\ ale#Escape('stylelint') . ' --whatever --stdin-filename %s',
\ ale_linters#html#stylelint#GetCommand(bufnr(''))