Skip to content

Commit 71f7c34

Browse files
authored
fix: TFSec outputs the same results multiple times (antonbabenko#237)
1 parent 3ae5eb0 commit 71f7c34

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.pre-commit-hooks.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
- id: terraform_tfsec
8080
name: Terraform validate with tfsec
8181
description: Static analysis of Terraform templates to spot potential security issues.
82+
require_serial: true
8283
entry: terraform_tfsec.sh
8384
language: script
8485

terraform_tfsec.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ main() {
66
parse_cmdline_ "$@"
77

88
# propagate $FILES to custom function
9-
tfsec_ "$ARGS" "$FILES"
9+
tfsec_ "$ARGS" "${FILES[*]}"
1010
}
1111

1212
tfsec_() {
1313
# consume modified files passed from pre-commit so that
1414
# tfsec runs against only those relevant directories
15-
for file_with_path in $FILES; do
15+
for file_with_path in ${FILES[*]}; do
1616
file_with_path="${file_with_path// /__REPLACED__SPACE__}"
1717
paths[index]=$(dirname "$file_with_path")
1818

0 commit comments

Comments
 (0)