mirror of https://github.com/dense-analysis/ale
fix: run opacheck on entire dir for more context
Running `opa check` on a single file can report errors that might not exist when considering other files in the same directory
This commit is contained in:
parent
3220b94d20
commit
fd07cb8787
|
@ -11,7 +11,7 @@ function! ale_linters#rego#opacheck#GetCommand(buffer) abort
|
|||
let l:options = ale#Var(a:buffer, 'rego_opacheck_options')
|
||||
|
||||
return ale#Escape(ale_linters#rego#opacheck#GetExecutable(a:buffer))
|
||||
\ . ' check %s --format json '
|
||||
\ . ' check %s:h --format json '
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -8,9 +8,9 @@ After:
|
|||
|
||||
Execute(The default command should be correct):
|
||||
AssertLinter 'opa',
|
||||
\ ale#Escape('opa') . ' check %s --format json '
|
||||
\ ale#Escape('opa') . ' check %s:h --format json '
|
||||
|
||||
Execute(The default command should be overridden):
|
||||
let b:ale_rego_opacheck_executable = '/bin/other/opa'
|
||||
AssertLinter '/bin/other/opa',
|
||||
\ ale#Escape('/bin/other/opa') . ' check %s --format json '
|
||||
\ ale#Escape('/bin/other/opa') . ' check %s:h --format json '
|
||||
|
|
Loading…
Reference in New Issue