chore: Document functions (based on google style guide) (#317)

This commit is contained in:
Maksym Vlasov 2022-01-11 15:54:42 +02:00 committed by GitHub
commit 321fb16693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 190 additions and 8 deletions

View file

@ -13,6 +13,18 @@ function main {
infracost_breakdown_ "${HOOK_CONFIG[*]}" "${ARGS[*]}"
}
#######################################################################
# Wrapper around `infracost breakdown` tool which checks and compares
# infra cost based on provided hook_config
# Environment variables:
# PRE_COMMIT_COLOR (string) If set to `never` - do not colorize output
# Arguments:
# hook_config (string with array) arguments that configure hook behavior
# args (string with array) arguments that configure wrapped tool behavior
# Outputs:
# Print out hook checks status (Passed/Failed), total monthly cost and
# diff, summary about infracost check (non-supported resources etc.)
#######################################################################
function infracost_breakdown_ {
local -r hook_config="$1"
local args