Run opacheck on entire dir for more context (#4531)
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-07-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions

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 Kelley
2025-03-11 13:05:06 -07:00
committed by GitHub
parent 61191dd4bf
commit 07b0496f6d
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')
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

View File

@@ -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 '