Skip to content

Commit

Permalink
chore(devcontainer): move pre-commit install to postAttach.sh
Browse files Browse the repository at this point in the history
Moved the `initialize hook environments` and `manage commit-msg hooks` commands
to postAttach.sh similar to the approach used in other cal-itp repos.
  • Loading branch information
lalver1 committed Jul 17, 2024
1 parent 95d2869 commit f9fee5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 0 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,3 @@ RUN pip install -e .[dev,test]
# docs requirements are in a separate file for the GitHub Action
COPY docs/requirements.txt docs/requirements.txt
RUN pip install -r docs/requirements.txt

# install pre-commit environments in throwaway Git repository
# https://stackoverflow.com/a/68758943
COPY .pre-commit-config.yaml .
RUN git init . && \
pre-commit install-hooks && \
rm -rf .git
7 changes: 6 additions & 1 deletion .devcontainer/postAttach.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ set -eu
# initialize pre-commit

git config --global --add safe.directory /calitp/app
pre-commit install --overwrite

# initialize hook environments
pre-commit install --install-hooks --overwrite

# manage commit-msg hooks
pre-commit install --hook-type commit-msg

0 comments on commit f9fee5c

Please sign in to comment.