Skip to content

Commit

Permalink
build: install precommit in dev container (alandtse#2728)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianegge authored Dec 6, 2024
1 parent 85b3f11 commit a39db58
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/

RUN pipx install poetry
WORKDIR /workspace
COPY pyproject.toml poetry.lock ./
# RUN poetry update
COPY pyproject.toml poetry.lock .pre-commit-config.yaml ./
RUN poetry update

# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
# COPY requirements.txt /tmp/pip-tmp/
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",

"postCreateCommand": "poetry update && poetry run pre-commit install",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"runArgs": ["--userns=keep-id"],
"containerUser": "vscode",
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
- id: check-yaml
exclude: ^recipes/.*
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0

# --- Commit msg checks ---
- hooks:
Expand Down

0 comments on commit a39db58

Please sign in to comment.