Skip to content

Commit 721a2be

Browse files
committed
chore: switch from gitlint to committed
For nice single binary install, one Python dependency fewer. Re .config/, https://github.com/pi0/config-dir committed is expected to run only from within git hooks, so we have the luxury to specify a path to the config.
1 parent 762018c commit 721a2be

File tree

8 files changed

+41
-33
lines changed

8 files changed

+41
-33
lines changed

.config/committed.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
style = "conventional"
2+
ignore_author_re = '\[bot\]'
3+
subject_capitalized = false

.github/renovate.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@
4040
"commitMessageTopic": "{{depName}}",
4141
"semanticCommitScope": "pre-commit"
4242
},
43-
{
44-
"versioning": "pep440",
45-
"groupName": "gitlint",
46-
"matchPackageNames": [
47-
"/(^|/)gitlint$/"
48-
]
49-
},
5043
{
5144
"matchPackageNames": [
5245
"perltidy/perltidy"

.github/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
-r ../test/requirements-dev.txt
22

3-
gitlint==0.19.1
43
pre-commit>=3.2.0

.github/workflows/ci.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
16-
with: # for gitlint
16+
with:
1717
persist-credentials: false
18-
ref: ${{ github.event.pull_request.head.sha }}
19-
fetch-depth: 0
2018
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
2119
with:
2220
python-version: ">=3.7"
@@ -33,8 +31,6 @@ jobs:
3331
python3 -m venv venv # for venv-run
3432
source venv/bin/activate
3533
python3 -m pip install -Ur .github/requirements.txt
36-
- run: venv/bin/gitlint --commits "origin/$GITHUB_BASE_REF..HEAD"
37-
if: github.event_name == 'pull_request'
3834
- name: Run pre-commit checks
3935
run: |
4036
source venv/bin/activate
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Lint commits
2+
3+
on:
4+
pull_request:
5+
6+
permissions: {}
7+
8+
jobs:
9+
lint-commits:
10+
name: Lint commits
11+
runs-on: ubuntu-latest
12+
env:
13+
FORCE_COLOR: true
14+
permissions:
15+
contents: read
16+
steps:
17+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
18+
with:
19+
fetch-depth: 0
20+
persist-credentials: false
21+
- uses: crate-ci/committed@bb02f309663f9baced8dbd5fdd80c6369ddf3efd # v1.1.8
22+
with:
23+
args: "-vv --no-merge-commit --config=.config/committed.toml"

.gitlint

Lines changed: 0 additions & 13 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ minimum_pre_commit_version: 3.2.0 # for "default_stages" names
33

44
repos:
55

6-
- repo: https://github.com/jorisroovers/gitlint
7-
rev: v0.19.1
6+
- repo: https://github.com/crate-ci/committed
7+
rev: v1.1.8
88
hooks:
9-
- id: gitlint
9+
- id: committed
10+
args:
11+
- --config=.config/committed.toml
12+
- --fixup
13+
- --wip
14+
- --commit-file
1015

1116
- repo: https://github.com/scop/pre-commit-shfmt
1217
rev: v3.12.0-2

CONTRIBUTING.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,12 @@ Also, please bear the following coding guidelines in mind:
173173
unrelated changes into a single commit.
174174

175175
- We use [Conventional Commits](https://www.conventionalcommits.org/)
176-
to format commit messages, with types and most other details from
177-
[commitlint's config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional).
178-
`gitlint` in our pre-commit config checks commit messages for
179-
conformance with these rules.
176+
to format commit messages.
177+
[`committed`](https://github.com/crate-ci/committed)
178+
is the tool we use in our pre-commit linting to check
179+
commit messages, using most of
180+
[its default rules](https://github.com/crate-ci/committed/blob/master/docs/reference.md#config-fields),
181+
in particular the conventional commit types.
180182

181183
It is important to do this correctly; commit types `fix` and `feat`
182184
as well as any change marked as breaking affects what ends up in the

0 commit comments

Comments
 (0)