-
-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add __GIT_WORKING_DIR__ to terraform_checkov #399
feat: Add __GIT_WORKING_DIR__ to terraform_checkov #399
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add related documentation to the readme (You can copy-paste related to __GIT_WORKING_DIR__
doc from tfsec
and little-bit change it)
hooks/terraform_checkov.sh
Outdated
# shellcheck disable=SC2128 # It's the simplest syntax for that case | ||
# shellcheck disable=SC2153 # False positive | ||
common::per_dir_hook "${ARGS[*]}" "$HOOK_ID" "${FILES[@]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's maintain one style across the codebase. Also, no need to expand ARGS to an array
# shellcheck disable=SC2128 # It's the simplest syntax for that case | |
# shellcheck disable=SC2153 # False positive | |
common::per_dir_hook "${ARGS[*]}" "$HOOK_ID" "${FILES[@]}" | |
# shellcheck disable=SC2128 # It's the simplest syntax for that case | |
common::per_dir_hook "$ARGS" "$HOOK_ID" "${FILES[@]}" |
pre-commit-terraform/hooks/terraform_tfsec.sh
Lines 16 to 20 in 598bf2c
# Support for setting PATH to repo root. | |
# shellcheck disable=SC2178 # It's the simplest syntax for that case | |
ARGS=${ARGS[*]/__GIT_WORKING_DIR__/$(pwd)\/} | |
# shellcheck disable=SC2128 # It's the simplest syntax for that case | |
common::per_dir_hook "$ARGS" "$HOOK_ID" "${FILES[@]}" |
@MaxymVlasov are you happy with these changes or would you like me to do anything else? |
# [1.73.0](v1.72.2...v1.73.0) (2022-06-27) ### Features * Add __GIT_WORKING_DIR__ to terraform_checkov ([#399](#399)) ([ae88ed7](ae88ed7))
This PR is included in version 1.73.0 🎉 |
Put an
x
into the box if that apply:Description of your changes
This PR adds support for
__GIT_WORKING_DIR__
to the newterraform_checkov
hook.Since the new hook cd into each directory, it now ignores the
checkov.yml
file in the root folder. The functionality can now be restored with:How can we test changes
checkov.yml
in the top directoryterraform_checkov
in a subdirectory:--args=--config-file __GIT_WORKING_DIR__/.checkov.yml
to the.pre-commit-config.yaml
fileterraform_checkov
in a subdirectory