summaryrefslogtreecommitdiff
path: root/.husky
Commit message (Collapse)AuthorAgeFilesLines
* build(hooks): allow hooks to skip CommitizenChris Kay2023-04-181-1/+3
| | | | | | | | | | | | | Adds a conditional check in the `prepare-commit-msg` commit hook that reads the `tf-a.disableCommitizen` Git configuration option, and does not execute Commitizen if it is found. To skip Commitizen, run: git config tf-a.disableCommitizen true Change-Id: Ic8967f6f42bf3555df09b57096044fb99438d4d4 Signed-off-by: Chris Kay <chris.kay@arm.com>
* style(hooks): adds Arm copyright style fixMaksims Svecovs2023-03-151-3/+9
| | | | | | | | | Adds a check to pre-commit hook that makes sure "Arm" is written in a correct case and not "arm" or "ARM". Same as a copyright-year check, the hook will fix the issue and prompt user to stage the fix. Change-Id: I39db148d6621d542193f3ee703bddc23c7e8dc27 Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
* feat(git-hooks): add pre-commit hookMaksims Svecovs2023-02-092-0/+63
| | | | | | | | | | Adds a pre-commit git hook to keep track of copyright year. Checks staged files for Arm copyright header and suggests a change if the year is outdated. Works with both single-year format and from_year-to_year format. Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com> Change-Id: If81a0b9f5e047ec0ac401c7cf1792b9da6644926
* build(hooks): add commitlint hookChris Kay2021-04-192-0/+4
| | | | | | | | | | | | | | | | | This change adds a configuration for commitlint - a tool designed to enforce a particular commit message style - and run it as part of Git's commit-msg hook. This validates commits immediately after the editor has been exited, and the configuration is derived from the configuration we provide to Commitizen. While the configuration provided suggests a maximum header and body length, neither of these are hard errors. This is to accommodate the occasional commit where it may be difficult or impossible to comply with the length requirements (for example, with a particularly long scope, or a long URL in the message body). Change-Id: Ib5e90472fd1f1da9c2bff47703c9682232ee5679 Signed-off-by: Chris Kay <chris.kay@arm.com>
* build(hooks): add Commitizen hookChris Kay2021-04-192-0/+34
| | | | | | | | | | | | | | | | | This change adds Commitizen, an interactive tool for writing commit messages, to the package.json file. This installs Commitizen within the `node_modules` directory automatically when developers invoke `npm install` from the root repository directory. Additionally, this change adds a prepare-commit-msg Git hook which invokes Commitizen prior to generation of the default commit message. It may be exited with the standard ^C signal without terminating the commit process for those who desperately want to avoid using it, but otherwise should encourage developers to conform to the new commit style without running into post-commit linting errors. Change-Id: I8a1e268ed40b61af38519d13d62b116fce76a494 Signed-off-by: Chris Kay <chris.kay@arm.com>
* build(hooks): add Gerrit hookChris Kay2021-04-192-0/+200
| | | | | | | | | | This change adds the Gerrit commit-msg hook to Husky, such that it now no longer requires manual installation by the developer. This hook was pulled directly from the TF-A Gerrit review server. Change-Id: I79c9b0ce78fd326fda6db7a930b7277690177f28 Signed-off-by: Chris Kay <chris.kay@arm.com>
* build(hooks): add Husky configurationChris Kay2021-04-191-0/+1
Husky is a tool for managing Git hooks within the repository itself. Traditionally, commit hooks need to be manually installed on a per-user basis, but Husky allows us to install these hooks either automatically when `npm install` is invoked within the repository, or manually with `npx husky install`. This will become useful for us in the next few patches when we begin introducing tools for enforcing a commit message style. Change-Id: I64cae147e9ea910347416cfe0bcc4652ec9b4830 Signed-off-by: Chris Kay <chris.kay@arm.com>