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:
Braden M. Kelley 2023-06-07 15:41:57 -07:00
parent 3220b94d20
commit fd07cb8787
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ function! ale_linters#rego#opacheck#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'rego_opacheck_options') let l:options = ale#Var(a:buffer, 'rego_opacheck_options')
return ale#Escape(ale_linters#rego#opacheck#GetExecutable(a:buffer)) return ale#Escape(ale_linters#rego#opacheck#GetExecutable(a:buffer))
\ . ' check %s --format json ' \ . ' check %s:h --format json '
\ . (!empty(l:options) ? ' ' . l:options : '') \ . (!empty(l:options) ? ' ' . l:options : '')
endfunction endfunction

View File

@ -8,9 +8,9 @@ After:
Execute(The default command should be correct): Execute(The default command should be correct):
AssertLinter 'opa', AssertLinter 'opa',
\ ale#Escape('opa') . ' check %s --format json ' \ ale#Escape('opa') . ' check %s:h --format json '
Execute(The default command should be overridden): Execute(The default command should be overridden):
let b:ale_rego_opacheck_executable = '/bin/other/opa' let b:ale_rego_opacheck_executable = '/bin/other/opa'
AssertLinter '/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 '