Skip to content

Commit 1ee4730

Browse files
Neno StefanovNenoStefanov
authored andcommitted
chore: add commit policy
1 parent 1ce00f9 commit 1ee4730

4 files changed

Lines changed: 76 additions & 0 deletions

File tree

.commitlintrc.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends:
2+
- '@commitlint/config-conventional'
3+
4+
rules:
5+
'header-max-length': [2, 'always', 50]
6+
'body-max-line-length': [2, 'always', 72]
7+
'type-enum': [2, 'always', ['feat', 'fix', 'perf', 'refactor', 'test', 'docs', 'ci', 'build', 'chore', 'revert']]

.gitcommit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# <type>: <header line up to 50 chars total>
2+
3+
# Explain what & why, wrapped at 72 characters per line.
4+
# Focus on rationale and intent, not implementation details.
5+
6+
# Footer: use only if needed.
7+
# - BREAKING CHANGE: describe incompatible change
8+
# - Other important notes (e.g. migration, deprecation)

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ on:
55
- pull_request
66

77
jobs:
8+
commitlint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
- name: Setup node
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: lts/*
18+
cache: npm
19+
- name: Lint branch commits with commitlint
20+
if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
21+
run: |
22+
npm install -g @commitlint/config-conventional @commitlint/cli
23+
commitlint --verbose \
24+
--from $(git merge-base origin/${{ github.event.repository.default_branch }} ${{ github.sha }}) \
25+
--to ${{ github.sha }}
26+
827
test:
928
runs-on: ubuntu-latest
1029
steps:

CONTRIBUTING.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Contributing to MIRACL Trust Client JS Library
2+
3+
## Git Commit Policy
4+
5+
> Concise rules for this repository.
6+
> Details: <https://www.conventionalcommits.org/>
7+
### Format
8+
9+
```txt
10+
<type>: <subject>
11+
<body>
12+
<footer>
13+
```
14+
15+
* **type**: use one of:
16+
17+
* `feat` — new feature or change in behaviour (e.g., `feat: add new feature`)
18+
* `fix` — bug fix (e.g., `fix: correct validation logic`)
19+
* `perf` — performance improvement, no behaviour change (e.g., `perf: improve
20+
response time`)
21+
* `refactor` — internal code change, no behaviour change. Includes
22+
formatting-only changes. (e.g., `refactor: reorganise module structure`)
23+
* `test` — adding missing tests or correcting existing tests (e.g., `test: add
24+
smoke test`)
25+
* `docs` — documentation (e.g., `docs: update guide`)
26+
* `ci` — CI configuration/jobs (e.g., `ci: increase job timeout`)
27+
* `build` — build system or artefacts (e.g., `build: update dockerfile`)
28+
* `chore` — maintenance (e.g., `chore: update dependencies`)
29+
* `revert` — revert (e.g., `revert: rollback previous change`)
30+
* **subject**: imperative, no full stop, does not start with a capital letter,
31+
**≤ 50 characters (including type)**
32+
* **body**: wrap at **72 characters**; explain **what & why** (not how)
33+
* **footer**: optional notes
34+
35+
### Commit template
36+
37+
A commit template with 50/72 visual guides is provided in
38+
[.gitcommit](/.gitcommit). Set it with:
39+
40+
```sh
41+
git config commit.template .gitcommit
42+
```

0 commit comments

Comments
 (0)