Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hooks/_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ function common::is_hook_run_on_whole_repo {
local all_files_that_can_be_checked

if [ -z "$excluded_files" ]; then
all_files_that_can_be_checked=$(git ls-files | sort | grep -e "$included_files" | tr '\n' ' ')
all_files_that_can_be_checked=$(git ls-files | sort | grep -E -- "$included_files" | tr '\n' ' ')
else
all_files_that_can_be_checked=$(git ls-files | sort | grep -e "$included_files" | grep -v -e "$excluded_files" | tr '\n' ' ')
all_files_that_can_be_checked=$(git ls-files | sort | grep -E -- "$included_files" | grep -v -E -- "$excluded_files" | tr '\n' ' ')
fi

if [ "$files_to_check" == "$all_files_that_can_be_checked" ]; then
Expand Down
2 changes: 1 addition & 1 deletion hooks/terraform_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function terraform_docs {
config_file_no_color="$config_file$(date +%s).yml"

if [ "$PRE_COMMIT_COLOR" = "never" ] &&
[[ $(grep -e '^formatter:' "$config_file") == *"pretty"* ]] &&
[[ $(grep -E '^formatter:' "$config_file") == *"pretty"* ]] &&
[[ $(grep ' color: ' "$config_file") != *"false"* ]]; then

cp "$config_file" "$config_file_no_color"
Expand Down
2 changes: 1 addition & 1 deletion hooks/terraform_trivy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function run_hook_on_whole_repo {
local -a -r args=("$@")

# pass the arguments to hook
trivy conf "$(pwd)" "${args[@]}"
trivy conf "$(pwd)" --exit-code=1 "${args[@]}"

# return exit code to common::per_dir_hook
local exit_code=$?
Expand Down