Skip to content

Commit 07b0496

Browse files
authored
Run opacheck on entire dir for more context (#4531)
Running `opa check` on a single file can report errors that might not exist when considering other files in the same directory
1 parent 61191dd commit 07b0496

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ale_linters/rego/opacheck.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function! ale_linters#rego#opacheck#GetCommand(buffer) abort
1111
let l:options = ale#Var(a:buffer, 'rego_opacheck_options')
1212

1313
return ale#Escape(ale_linters#rego#opacheck#GetExecutable(a:buffer))
14-
\ . ' check %s --format json '
14+
\ . ' check %s:h --format json '
1515
\ . (!empty(l:options) ? ' ' . l:options : '')
1616
endfunction
1717

test/linter/test_rego_opacheck.vader

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ After:
88

99
Execute(The default command should be correct):
1010
AssertLinter 'opa',
11-
\ ale#Escape('opa') . ' check %s --format json '
11+
\ ale#Escape('opa') . ' check %s:h --format json '
1212

1313
Execute(The default command should be overridden):
1414
let b:ale_rego_opacheck_executable = '/bin/other/opa'
1515
AssertLinter '/bin/other/opa',
16-
\ ale#Escape('/bin/other/opa') . ' check %s --format json '
16+
\ ale#Escape('/bin/other/opa') . ' check %s:h --format json '

0 commit comments

Comments
 (0)