Skip to content

Commit

Permalink
build: add commitlint to pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chemelli74 committed Oct 9, 2024
1 parent bc2d2af commit 529061c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
17 changes: 0 additions & 17 deletions .commitlint.config.mjs

This file was deleted.

4 changes: 4 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
FROM mcr.microsoft.com/devcontainers/python:1-3.11

# [Option] Install Node.js
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

# Install Python dependencies from requirements
COPY requirements*.txt /tmp/pip-tmp/
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,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/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
Expand Down
6 changes: 6 additions & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
extends: ["@commitlint/config-conventional"],
rules: {
"body-max-line-length": [2, "always", 300],
},
};
3 changes: 3 additions & 0 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
set -e

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

0 comments on commit 529061c

Please sign in to comment.