Skip to content

Commit

Permalink
Merge pull request #166 from chemelli74/chemelli74-commlint-local
Browse files Browse the repository at this point in the history
build: add commitlint to pre-commit
  • Loading branch information
chemelli74 authored Oct 9, 2024
2 parents 2bdc6ee + f740c34 commit 65ce88f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG VARIANT="3.11"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

# [Option] Install Node.js
ARG INSTALL_NODE="false"
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"context": "..",
"args": {
"VARIANT": "3.11",
"INSTALL_NODE": "false",
"INSTALL_NODE": "true",
"NODE_VERSION": "lts/*"
}
},
Expand All @@ -26,6 +26,6 @@
]
}
},
"postCreateCommand": "pre-commit install",
"postCreateCommand": "scripts/setup.sh",
"remoteUser": "vscode"
}
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ repos:
hooks:
- id: commitizen
stages: [commit-msg]
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.18.0
hooks:
- id: commitlint
stages: [commit-msg]
- repo: https://github.com/python-poetry/poetry
rev: 1.8.0
hooks:
Expand Down
10 changes: 10 additions & 0 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Setups the repository.

# Stop on errors
set -e

pre-commit install
pre-commit install --hook-type commit-msg
cd
npm install @commitlint/config-conventional

0 comments on commit 65ce88f

Please sign in to comment.