Skip to content
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 pre-commit hooks for automated code quality checks #3001

Merged
merged 1 commit into from
Feb 18, 2025
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
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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.*)
2 changes: 0 additions & 2 deletions contrib/spark/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions tests/gh-actions/install_knative-cni.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
5 changes: 2 additions & 3 deletions tests/gh-actions/install_knative.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down