diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-10-31 11:21:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-31 11:21:13 +0000 |
commit | 20e4e3f9db1e46306bbe8ba5c33db92950b2e927 (patch) | |
tree | 9e15c0feeefeec349525f78ae47da0d215076d50 | |
parent | cdda96154e0bb397b7fa1f1ca04cbcbb28a754f8 (diff) | |
parent | 39fd7a09613145fe6799716da3d4158bf0d35092 (diff) | |
download | ale-20e4e3f9db1e46306bbe8ba5c33db92950b2e927.zip |
Merge pull request #2040 from leamingrad/jshint_filename
Pass the filename of the current file into jshint
-rw-r--r-- | ale_linters/javascript/jshint.vim | 2 | ||||
-rw-r--r-- | test/command_callback/test_jshint_command_callback.vader | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/ale_linters/javascript/jshint.vim b/ale_linters/javascript/jshint.vim index 83909fa4..cb7f66fc 100644 --- a/ale_linters/javascript/jshint.vim +++ b/ale_linters/javascript/jshint.vim @@ -18,7 +18,7 @@ function! ale_linters#javascript#jshint#GetCommand(buffer) abort let l:command .= ' --config ' . ale#Escape(l:jshint_config) endif - let l:command .= ' -' + let l:command .= ' --filename %s -' return l:command endfunction diff --git a/test/command_callback/test_jshint_command_callback.vader b/test/command_callback/test_jshint_command_callback.vader new file mode 100644 index 00000000..d665a9c1 --- /dev/null +++ b/test/command_callback/test_jshint_command_callback.vader @@ -0,0 +1,14 @@ +Before: + call ale#assert#SetUpLinterTest('javascript', 'jshint') + +After: + call ale#assert#TearDownLinterTest() + +Execute(The default command should be correct): + + AssertLinter 'jshint', '''jshint'' --reporter unix --extract auto --filename %s -' + +Execute(Setting a config location should add the config parameter): + let g:ale_jshint_config_loc = '/some/file' + + AssertLinter 'jshint', '''jshint'' --reporter unix --extract auto --config ''/some/file'' --filename %s -' |