arm-trusted-firmware/.commitlintrc.js
Chris Kay fa3a13824a build(hooks): add commitlint checks for trailers
This change adds checks for the `Change-Id` and `Signed-off-by`
trailers. These are already required by Gerrit, so they have been
configured as warnings as an early heads-up after committing without
needing to push.

This also renames the commitlint configuration file to align it with
the style used by Standard Version when it's eventually introduced:

    `commitlint.config.js` -> `.commitlintrc.js`

Change-Id: I4e3c158e6b3a5407fabd873360d5efce86ebd19e
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-11-17 16:04:36 +00:00

31 lines
846 B
JavaScript

/*
* Copyright (c) 2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/* eslint-env es6 */
"use strict";
const cz = require("./.cz.json");
const { "trailer-exists": trailerExists } = require("@commitlint/rules").default;
module.exports = {
extends: ["@commitlint/config-conventional"],
plugins: [
{
rules: {
"signed-off-by-exists": trailerExists,
"change-id-exists": trailerExists,
},
},
],
rules: {
"body-max-line-length": [1, "always", cz.maxLineWidth], /* Warning */
"header-max-length": [1, "always", cz.maxHeaderWidth], /* Warning */
"change-id-exists": [1, "always", "Change-Id:"], /* Warning */
"signed-off-by-exists": [1, "always", "Signed-off-by:"], /* Warning */
},
};