feat: Add pre-commit hooks for automated code quality checks (#3001)

Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
This commit is contained in:
Harshvir Potpose 2025-02-18 21:03:41 +05:30 committed by GitHub
parent e277a6e29d
commit 88c67229aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 26 additions and 8 deletions

22
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,22 @@
repos:
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
files: ^(common|example)/.*\.py$
exclude: .*upstream.*
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
files: ^(common|example|hack|tests|\.github)/.*\.ya?ml$
exclude: .*upstream.*
args: [--config-file=.yamllint.yaml]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
files: ^.*\.sh$
exclude: (^apps/.*|.*upstream.*)

View File

@ -4,8 +4,6 @@ set -euxo
NAMESPACE=$1
TIMEOUT=120 # timeout in seconds
SLEEP_INTERVAL=30 # interval between checks in seconds
SPARK_VERSION=3.5.2
start_time=$(date +%s)
for ((i=0; i<TIMEOUT; i+=2)); do

View File

@ -5,9 +5,8 @@ echo "Installing KNative with Istio-CNI ..."
# Retry mechanism for applying Knative manifests
set +e
for i in {1..5}; do
kustomize build common/knative/knative-serving/base | kubectl apply -f -
if [[ $? -eq 0 ]]; then
for _ in {1..5}; do
if kustomize build common/knative/knative-serving/base | kubectl apply -f -; then
break
fi
echo "Retrying in 30 seconds..."

View File

@ -5,9 +5,8 @@ echo "Installing KNative ..."
# Retry mechanism for applying Knative manifests
set +e
for i in {1..5}; do
kustomize build common/knative/knative-serving/base | kubectl apply -f -
if [[ $? -eq 0 ]]; then
for _ in {1..5}; do
if kustomize build common/knative/knative-serving/base | kubectl apply -f -; then
break
fi
echo "Retrying in 30 seconds..."