Skip to content

Commit

Permalink
Merge pull request #797 from irq0/pr/pre-commit-shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Lauhoff authored Nov 13, 2023
2 parents 612ae59 + c28d57d commit ad215c8
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 14 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,17 @@ jobs:
- name: Set up Python3
uses: actions/setup-python@v4

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v36

- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "Changed: $file"
done
- name: Pre Commit
uses: pre-commit/[email protected]
with:
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ jobs:
export S3TEST_LIST="${FIXTURES}/s3-tests.txt"
# There are some s3tests that don't finish at all. Only run
# known-to-pass tests for now. TODO: fix inifite looping tests
# known-to-pass tests for now. TODO: fix infinite looping tests
# sed -r -i 's/^# //' "${S3TEST_LIST}"
pushd s3tests
Expand Down
21 changes: 13 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand All @@ -17,7 +17,7 @@ repos:
- id: check-case-conflict

- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5
rev: 3.0.0
hooks:
- id: forbid-binary
exclude: >-
Expand All @@ -27,12 +27,12 @@ repos:
- id: git-check

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
rev: v2.2.6
hooks:
- id: codespell

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v6.14.1
rev: v8.0.0
hooks:
- id: cspell
args:
Expand All @@ -49,7 +49,7 @@ repos:
- id: markdownlint-cli2

- repo: https://github.com/ambv/black
rev: 23.3.0
rev: 23.11.0
hooks:
- id: black
language_version: python3.10
Expand All @@ -62,7 +62,7 @@ repos:
files: (?x)^tools/(release|s3tests)/.+\.py$

- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -72,7 +72,7 @@ repos:
files: (?x)^tools/(release|s3tests)/.+\.py$

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.1.1'
rev: 'v1.7.0'
hooks:
- id: mypy
additional_dependencies:
Expand All @@ -82,8 +82,13 @@ repos:
files: (?x)^tools/(release|s3tests)/.+\.py$

- repo: https://github.com/asottile/pyupgrade
rev: v2.10.0
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py36-plus]
files: (?x)^tools/(release|s3tests)/.+\.py$

- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
hooks:
- id: shellcheck
2 changes: 1 addition & 1 deletion tools/minikube/instant-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ traefik_cluster_ip="$(kubectl \
get service \
traefik-ingress -ojsonpath='{.spec.clusterIP}')"
helm_values_file="$(mktemp)"
trap "rm $helm_values_file" EXIT
trap 'rm $helm_values_file' EXIT

cat >"$helm_values_file" <<EOF
ingress:
Expand Down
7 changes: 3 additions & 4 deletions tools/tests/on-disk-format-checker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@ start_s3gw() {
echo "Container failed to start or crashed"
echo "Showing logs..."
echo "---------------------------------------------"
_podman logs ${CONTAINER}
_podman logs "${CONTAINER}"
echo "---------------------------------------------"
METADATA_ISSUE=$(_podman logs ${CONTAINER} | grep "ERROR ACCESSING SFS METADATA")
if [ "$?" -eq 0 ]; then
echo "Format of metadata has changed. Breaking changes inconsitencies found."
if _podman logs "${CONTAINER}" | grep "ERROR ACCESSING SFS METADATA"; then
echo "Format of metadata has changed. Breaking changes inconsistencies found."
fi
exit 1
fi
Expand Down

0 comments on commit ad215c8

Please sign in to comment.