Skip to content
Merged
Changes from 1 commit
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
23 changes: 14 additions & 9 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -142,24 +142,27 @@ function check_incorrect_makefile_variable_brackets() {
}

function pre_commit() {
if [[ "${SKIP_UPDATE_LICENSES:-""}" != "true" ]]; then
( (time update_licenses) 2>&1 | prepend "update_licenses" ) &
fi
( (time scripts/evergreen/lint_code.sh) 2>&1 | prepend "lint_code.sh" ) &
( (time start_shellcheck) 2>&1 | prepend "shellcheck" ) &

# Update release.json first in case there is a newer version
(time update_release_json) 2>&1 | prepend "update_release_json"
# We need to generate the values files first
(time update_values_yaml_files) 2>&1 | prepend "update_values_yaml_files"
# The values files are used for generating the standalone yaml
(time generate_standalone_yaml) 2>&1 | prepend "generate_standalone_yaml"
# Run black on python files that have changed
(time python_formatting) 2>&1 | prepend "python_formatting"

(time regenerate_public_rbac_multi_cluster) 2>&1 | prepend "regenerate_public_rbac_multi_cluster"
( (time regenerate_public_rbac_multi_cluster) 2>&1 | prepend "regenerate_public_rbac_multi_cluster" ) &

(time start_shellcheck) 2>&1 | prepend "shellcheck"

(time check_erroneous_kubebuilder_annotations) 2>&1 | prepend "check_erroneous_kubebuilder_annotations"
# Run black on python files that have changed
( (time python_formatting) 2>&1 | prepend "python_formatting") &

(time scripts/evergreen/lint_code.sh) 2>&1 | prepend "lint_code.sh"
( (time check_erroneous_kubebuilder_annotations) 2>&1 | prepend "check_erroneous_kubebuilder_annotations" ) &

(time update_licenses) 2>&1 | prepend "update_licenses"
wait
}

# Function to run shellcheck on a single file
Expand Down Expand Up @@ -196,7 +199,9 @@ if [[ "${cmd}" == "generate_standalone_yaml" ]]; then
shift 1
generate_standalone_yaml "$@"
elif [[ "${cmd}" == "pre-commit" ]]; then
pre_commit
time pre_commit
elif [[ "${cmd}" == "pre-commit-skip-license" ]]; then
time pre_commit "skip-license"
elif [[ "${cmd}" == "shellcheck" ]]; then
start_shellcheck
elif [[ "${cmd}" == "lint" ]]; then
Expand Down