Skip to content

Commit

Permalink
fix: run opacheck on entire dir for more context
Browse files Browse the repository at this point in the history
Running `opa check` on a single file can report errors that might not
exist when considering other files in the same directory
  • Loading branch information
redbmk committed Jun 7, 2023
1 parent 7021ed0 commit 3074422
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ale_linters/rego/opacheck.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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 . --format json '
\ . (!empty(l:options) ? ' ' . l:options : '')
endfunction

Expand Down
4 changes: 2 additions & 2 deletions test/linter/test_rego_opacheck.vader
Original file line number Diff line number Diff line change
Expand Up @@ -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 . --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 . --format json '

0 comments on commit 3074422

Please sign in to comment.