Skip to content

Commit 64ad4b7

Browse files
committed
ci: enable gitlint
Applied rules: - Built-in rulles: all defaults, except: - Do not ignore cleanup commits (conflicts with CC2) - Do not ignore merge commits (they will fail with the rule below) - Custom title regex, enforce `area[/subarea]: description`, e.g. `docs: add new GSG guide`, `drivers/qspi: fix quad-line access`, etc. - Contrib rules: - CC1: require Signed-off-by (DCO) - CC2: no cleanup commits (fixup!, squash!, amend!) Ref. https://jorisroovers.com/gitlint/latest/rules/ Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
1 parent 470eabc commit 64ad4b7

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/gitlint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Lint Git Commits
2+
3+
on:
4+
pull_request: {}
5+
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
with:
13+
ref: ${{ github.event.pull_request.head.sha }}
14+
fetch-depth: 0
15+
16+
- name: Install GitLint
17+
run: pip install gitlint
18+
19+
- name: Run GitLint
20+
run: gitlint --commits "${{ github.event.pull_request.base.sha }}..HEAD"

.gitlint

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[general]
2+
contrib=contrib-body-requires-signed-off-by,contrib-disallow-cleanup-commits
3+
ignore-merge-commits=false
4+
ignore-fixup-commits=false
5+
ignore-fixup-amend-commits=false
6+
ignore-squash-commits=false
7+
8+
[title-match-regex]
9+
regex=[a-z0-9/]+: .*

0 commit comments

Comments
 (0)