diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 0000000..2a875d1 --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,7 @@ +{ + "extends": ["@commitlint/config-conventional"], + "rules": { + "type-enum": [2, "always", ["feat", "fix", "chore", "docs", "style", "refactor", "test", "perf", "ci", "WIP"]], + "type-case": [0, "always", "lower-case"] + } +} \ No newline at end of file diff --git a/.gitea/workflows/commitlint.yml b/.gitea/workflows/commitlint.yml new file mode 100644 index 0000000..214fd36 --- /dev/null +++ b/.gitea/workflows/commitlint.yml @@ -0,0 +1,16 @@ +name: commitlint + +on: + pull_request: + branches: + - "*" + +jobs: + check-and-test: + runs-on: ubuntu-latest + container: commitlint/commitlint:19.7.1 + steps: + - uses: actions/checkout@v4 + - name: check PR title + run: | + echo "${{ gitea.event.pull_request.title }}" | commitlint --config .commitlintrc.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 94f45b1..05632bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,6 +29,7 @@ When submitting or updating a PR: - try to avoid rebases. They make code reviews for large PRs and comments much harder. - if applicable, use the PR template for a well-defined PR description. - clearly mark breaking changes. +- format the PR title following the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#specification) schema ## Local development & testing