summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/c/cquery.vim5
-rw-r--r--ale_linters/cpp/cquery.vim4
-rw-r--r--ale_linters/javascript/eslint.vim2
3 files changed, 9 insertions, 2 deletions
diff --git a/ale_linters/c/cquery.vim b/ale_linters/c/cquery.vim
index 7daf9f76..a20782a2 100644
--- a/ale_linters/c/cquery.vim
+++ b/ale_linters/c/cquery.vim
@@ -6,6 +6,11 @@ call ale#Set('c_cquery_cache_directory', expand('~/.cache/cquery'))
function! ale_linters#c#cquery#GetProjectRoot(buffer) abort
let l:project_root = ale#path#FindNearestFile(a:buffer, 'compile_commands.json')
+
+ if empty(l:project_root)
+ let l:project_root = ale#path#FindNearestFile(a:buffer, '.cquery')
+ endif
+
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
endfunction
diff --git a/ale_linters/cpp/cquery.vim b/ale_linters/cpp/cquery.vim
index 39eebce3..b1c81989 100644
--- a/ale_linters/cpp/cquery.vim
+++ b/ale_linters/cpp/cquery.vim
@@ -7,6 +7,10 @@ call ale#Set('cpp_cquery_cache_directory', expand('~/.cache/cquery'))
function! ale_linters#cpp#cquery#GetProjectRoot(buffer) abort
let l:project_root = ale#path#FindNearestFile(a:buffer, 'compile_commands.json')
+ if empty(l:project_root)
+ let l:project_root = ale#path#FindNearestFile(a:buffer, '.cquery')
+ endif
+
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
endfunction
diff --git a/ale_linters/javascript/eslint.vim b/ale_linters/javascript/eslint.vim
index 5be2377b..23e16949 100644
--- a/ale_linters/javascript/eslint.vim
+++ b/ale_linters/javascript/eslint.vim
@@ -1,8 +1,6 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: eslint for JavaScript files
-call ale#handlers#eslint#InitVariables()
-
call ale#linter#Define('javascript', {
\ 'name': 'eslint',
\ 'output_stream': 'both',