File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -50,16 +50,20 @@ function per_dir_hook_unique_part {
5050 shift
5151 local -a -r args=(" $@ " )
5252
53+ # we want to use the chdir function of tflint so that the errors are relative to the repo root
54+ popd > /dev/null
55+
5356 # Print checked PATH **only** if TFLint have any messages
5457 # shellcheck disable=SC2091,SC2068 # Suppress error output
55- $( tflint ${args[@]} 2>&1 ) 2> /dev/null || {
58+ $( tflint --chdir= " $dir_path " ${args[@]} 2>&1 ) 2> /dev/null || {
5659 common::colorify " yellow" " TFLint in $dir_path /:"
5760
58- tflint " ${args[@]} "
61+ tflint --chdir= " $dir_path " " ${args[@]} "
5962 }
6063
6164 # return exit code to common::per_dir_hook
6265 local exit_code=$?
66+ pushd $dir_path > /dev/null
6367 return $exit_code
6468}
6569
You can’t perform that action at this time.
0 commit comments