From 6d86f5027d7ca444907fa28dd4e4684e64707043 Mon Sep 17 00:00:00 2001 From: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Date: Mon, 14 Jul 2025 20:18:54 -0400 Subject: [PATCH 1/3] ci: add commitlint --- .github/workflows/commitlint.yml | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/commitlint.yml diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 000000000..18a1c2c7c --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,41 @@ +name: CI + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: lts/* + + - name: Install commitlint + run: npm install -D @commitlint/cli @commitlint/config-conventional + + - name: Setup commitlint + run: | + echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js + + - name: Print versions + run: | + git --version + node --version + npm --version + npx commitlint --version + + - name: Validate current commit (last commit) with commitlint + if: github.event_name == 'push' + run: npx commitlint --last --verbose + + - name: Validate PR commits with commitlint + if: github.event_name == 'pull_request' + run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose From bc5929fcc5741760661abe558cf3a0b33360c585 Mon Sep 17 00:00:00 2001 From: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Date: Mon, 14 Jul 2025 20:29:44 -0400 Subject: [PATCH 2/3] docs: use conventional commits --- CONTRIBUTING.md | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6325f3a06..5fe7f6401 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -119,25 +119,15 @@ mkdocs build --strict ## Commit Message -Read -[Git Contribution Guidelines](https://git-scm.com/docs/SubmittingPatches#describe-changes). - -In a nutshell: - -- **First Line**: `component: description of the patch` in all lowercase - unless it's in a cap in the code. -- **Body**: In 2-3 paragraphs: - 1. the current problem you want to solve - 2. justification of your change - 3. if any, alternative solutions considered but discarded +Follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). ## Pull Request Style -1. **Title**: Follow the First Line rule of [Commit Message](#commit-message). -2. **Description**: Follow the Body rule of [Commit Message](#commit-message). +1. **Title**: Follow Conventional Commits. +2. **Description**: Follow Conventional Commits. 3. **CI**: Verify that all CI checks pass on your fork before submitting the PR. Avoid relying on the CI of this repository to catch errors, as this can cause delays or stalls for other contributors. -4. **Commits**: There is no need to squash commits within the PR +4. **Commits**: There is no need to squash / force push commits within the PR unless explicitly requested. Keeping separate commits can help reviewers understand the progression of changes. From 9de3a7235c6e9153aa41f6d28d8134919bb127ed Mon Sep 17 00:00:00 2001 From: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Date: Mon, 14 Jul 2025 20:40:15 -0400 Subject: [PATCH 3/3] docs: remove mention of PR title & description --- CONTRIBUTING.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5fe7f6401..b51e6420b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -123,11 +123,9 @@ Follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). ## Pull Request Style -1. **Title**: Follow Conventional Commits. -2. **Description**: Follow Conventional Commits. -3. **CI**: Verify that all CI checks pass on your fork before submitting the +1. **CI**: Verify that all CI checks pass on your fork before submitting the PR. Avoid relying on the CI of this repository to catch errors, as this can cause delays or stalls for other contributors. -4. **Commits**: There is no need to squash / force push commits within the PR +2. **Commits**: There is no need to squash / force push commits within the PR unless explicitly requested. Keeping separate commits can help reviewers understand the progression of changes.