Skip to content

Commit 9d30a60

Browse files
Neno StefanovNenoStefanov
authored andcommitted
chore: add commit policy
1 parent b87839b commit 9d30a60

File tree

4 files changed

+67
-1
lines changed

4 files changed

+67
-1
lines changed

.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: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
1416
- name: Install swiftlint and swiftformat
1517
run: |
1618
brew update
@@ -27,7 +29,14 @@ jobs:
2729
- name: Lint README.md
2830
run: |
2931
npm install -g markdownlint-cli
30-
markdownlint README.md
32+
markdownlint README.md
33+
- name: Lint branch commits with commitlint
34+
if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
35+
run: |
36+
npm install -g @commitlint/config-conventional @commitlint/cli
37+
commitlint --verbose \
38+
--from $(git merge-base origin/${{ github.event.repository.default_branch }} ${{ github.sha }}) \
39+
--to ${{ github.sha }}
3140
3241
test:
3342
runs-on: macos-latest

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 iOS SDK
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)