Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends:
- '@commitlint/config-conventional'

rules:
'header-max-length': [2, 'always', 50]
'body-max-line-length': [2, 'always', 72]
'type-enum': [2, 'always', ['feat', 'fix', 'perf', 'refactor', 'test', 'docs', 'ci', 'build', 'chore', 'revert']]
8 changes: 8 additions & 0 deletions .gitcommit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# <type>: <header line up to 50 chars total>

# Explain what & why, wrapped at 72 characters per line.
# Focus on rationale and intent, not implementation details.

# Footer: use only if needed.
# - BREAKING CHANGE: describe incompatible change
# - Other important notes (e.g. migration, deprecation)
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ on:
- pull_request

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/*
cache: npm
- name: Lint branch commits with commitlint
if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
run: |
npm install -g @commitlint/config-conventional @commitlint/cli
commitlint --verbose \
--from $(git merge-base origin/${{ github.event.repository.default_branch }} ${{ github.sha }}) \
--to ${{ github.sha }}

test:
runs-on: ubuntu-latest
steps:
Expand Down
42 changes: 42 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Contributing to MIRACL Trust Client JS Library

## Git Commit Policy

> Concise rules for this repository.
> Details: <https://www.conventionalcommits.org/>
### Format

```txt
<type>: <subject>
<body>
<footer>
```

* **type**: use one of:

* `feat` — new feature or change in behaviour (e.g., `feat: add new feature`)
* `fix` — bug fix (e.g., `fix: correct validation logic`)
* `perf` — performance improvement, no behaviour change (e.g., `perf: improve
response time`)
* `refactor` — internal code change, no behaviour change. Includes
formatting-only changes. (e.g., `refactor: reorganise module structure`)
* `test` — adding missing tests or correcting existing tests (e.g., `test: add
smoke test`)
* `docs` — documentation (e.g., `docs: update guide`)
* `ci` — CI configuration/jobs (e.g., `ci: increase job timeout`)
* `build` — build system or artefacts (e.g., `build: update dockerfile`)
* `chore` — maintenance (e.g., `chore: update dependencies`)
* `revert` — revert (e.g., `revert: rollback previous change`)
* **subject**: imperative, no full stop, does not start with a capital letter,
**≤ 50 characters (including type)**
* **body**: wrap at **72 characters**; explain **what & why** (not how)
* **footer**: optional notes

### Commit template

A commit template with 50/72 visual guides is provided in
[.gitcommit](/.gitcommit). Set it with:

```sh
git config commit.template .gitcommit
```