Skip to content

Commit 05e1f96

Browse files
authored
Fix dockerfilegraph pre-commit hook (vllm-project#17698)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
1 parent 6eae345 commit 05e1f96

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ repos:
125125
name: Update Dockerfile dependency graph
126126
entry: tools/update-dockerfile-graph.sh
127127
language: script
128-
files: ^docker/Dockerfile$
129-
pass_filenames: false
130128
# Keep `suggestion` last
131129
- id: suggestion
132130
name: Suggestion
1.11 KB
Loading

tools/update-dockerfile-graph.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44

55
set -euo pipefail
66

7-
# Check if docker/Dockerfile is staged for commit
8-
if git diff --cached --name-only | grep -q "^docker/Dockerfile$"; then
7+
# Accept file paths as arguments
8+
FILES=("$@")
9+
10+
# Check if docker/Dockerfile is among the provided files
11+
if printf '%s\n' "${FILES[@]}" | grep -q "^docker/Dockerfile$"; then
912
echo "docker/Dockerfile has changed, attempting to update dependency graph..."
1013

1114
# Check if Docker is installed and running
@@ -75,4 +78,4 @@ if git diff --cached --name-only | grep -q "^docker/Dockerfile$"; then
7578
fi
7679
fi
7780

78-
exit 0
81+
exit 0

0 commit comments

Comments
 (0)