File tree Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
1515 apt-get install -y nodejs
1616
1717# Install Rust
18- RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
19- . $HOME/ .cargo/env
18+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
19+ ENV PATH="/root/ .cargo/bin:${PATH}"
2020
2121# Markdown
2222RUN npm install -g markdownlint-cli
Original file line number Diff line number Diff line change @@ -23,16 +23,21 @@ precommit-check:
2323
2424# Run pre-commit hooks in a Docker container
2525# and you can exec container to run bash for debug.
26+ # export PRECOMMIT_CONTAINER=ghcr.io/vllm-project/semantic-router/precommit:latest
2627# docker run --rm -it \
27- # -v $(shell pwd):/app \
28- # --name precommit-container ${PRECOMMIT_CONTAINER} \
29- # cd /app &&
30- # bash
28+ # -v $(pwd):/app \
29+ # -w /app \
30+ # --name precommit-container ${PRECOMMIT_CONTAINER} \
31+ # bash
3132precommit-local :
32- docker pull ${PRECOMMIT_CONTAINER}
33+ @if ! docker image inspect ${PRECOMMIT_CONTAINER} > /dev/null 2>&1 ; then \
34+ echo " Image not found locally. Pulling..." ; \
35+ docker pull ${PRECOMMIT_CONTAINER} ; \
36+ else \
37+ echo " Image found locally. Skipping pull." ; \
38+ fi
3339 docker run --rm \
34- -v $(pwd ) :/app \
35- --name precommit-container ${PRECOMMIT_CONTAINER}
36- cd /app && \
37- pre-commit install && \
38- pre-commit run --all-files
40+ -v $(pwd ) :/app \
41+ -w /app \
42+ --name precommit-container ${PRECOMMIT_CONTAINER} \
43+ bash -c " pre-commit install && pre-commit run --all-files"
You can’t perform that action at this time.
0 commit comments