summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-01-31 11:16:50 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2023-01-31 13:25:25 +0200
commitf05a0c1dde8c1cbe644aa71fc5b9e22ace34eb72 (patch)
tree2f074dd197e0be9048f32acd4afeee08842ad4cc
parent843427dd691811773156e23b9011f269f4c370f3 (diff)
tools: Add commit linter
Run under Github Actions, and restrict commit messages, structure, with, etc. Enforce using only our specified prefixes for commit messages. It reduces the work release managers do when _crafting_ release notes. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
-rw-r--r--.github/commitlint.config.js44
-rw-r--r--.github/workflows/commitlint.yml19
2 files changed, 63 insertions, 0 deletions
diff --git a/.github/commitlint.config.js b/.github/commitlint.config.js
new file mode 100644
index 0000000000..cf7daab867
--- /dev/null
+++ b/.github/commitlint.config.js
@@ -0,0 +1,44 @@
+module.exports = {
+ rules: {
+ 'header-max-length': [2, 'always', 72],
+ 'type-case': [2, 'always', 'lower-case'],
+ 'type-empty': [2, 'never'],
+ 'type-enum': [
+ 2,
+ 'always',
+ [
+ 'babeld',
+ 'bfdd',
+ 'bgpd',
+ 'doc',
+ 'docker',
+ 'eigrpd',
+ 'fpm',
+ 'isisd',
+ 'ldpd',
+ 'lib',
+ 'multi',
+ 'nhrpd',
+ 'ospf6d',
+ 'ospfd',
+ 'pbrd',
+ 'pimd',
+ 'pim6d',
+ 'ripd',
+ 'ripngd',
+ 'sharpd',
+ 'staticd',
+ 'tests',
+ 'tools',
+ 'vtysh',
+ 'vrrpd',
+ 'yang',
+ 'zebra',
+ 'all',
+ ],
+ ],
+ 'subject-empty': [2, 'never'],
+ 'subject-full-stop': [2, 'never', '.'],
+ 'subject-case': [2, 'always', 'sentence-case'],
+ },
+};
diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml
new file mode 100644
index 0000000000..a1f273a2ce
--- /dev/null
+++ b/.github/workflows/commitlint.yml
@@ -0,0 +1,19 @@
+name: commitlint
+
+on:
+ pull_request_target:
+ types:
+ - opened
+ - reopened
+
+jobs:
+ lint:
+ if: github.repository == 'frrouting/frr'
+ permissions:
+ contents: read
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check Commit
+ uses: wagoid/commitlint-github-action@v5
+ with:
+ configFile: .github/commitlint.config.js