Merge changes from topic "ck/conventional-commits" into integration

* changes:
  build(hooks): add commitlint hook
  build(hooks): add Commitizen hook
  build(hooks): add Gerrit hook
  build(hooks): add Husky configuration
This commit is contained in:
Joanna Farley 2021-04-21 12:55:14 +02:00 committed by TrustedFirmware Code Review
commit 745df30514
13 changed files with 8127 additions and 10 deletions

View file

@ -75,6 +75,12 @@ These tools are optional:
The standard software package used for debugging software on Arm development
platforms and |FVP| models.
- Node.js >= 14
Highly recommended, and necessary in order to install and use the packaged
Git hooks and helper tools. Without these tools you will need to rely on the
CI for feedback on commit message conformance.
Package Installation (Linux)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -91,6 +97,17 @@ The optional packages can be installed using:
sudo apt install device-tree-compiler
Additionally, to install an up-to-date version of Node.js, you can use the `Node
Version Manager`_ to install a version of your choosing (we recommend 14, but
later LTS versions might offer a more stable experience):
.. code:: shell
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | "$SHELL"
exec "$SHELL" -ic "nvm install 14; exec $SHELL"
.. _Node Version Manager: https://github.com/nvm-sh/nvm#install--update-script
Supporting Files
----------------
@ -109,27 +126,43 @@ in your shell:
.. code:: shell
git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a" && (cd "trusted-firmware-a" && mkdir -p .git/hooks && curl -Lo `git rev-parse --git-dir`/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg; chmod +x `git rev-parse --git-dir`/hooks/commit-msg)
git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a"
This will clone the Git repository also install a *commit hook* that
automatically inserts appropriate *Change-Id:* lines at the end of your
commit messages. These change IDs are required when committing changes that you
intend to push for review via our Gerrit system.
Additional Steps for Contributors
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can read more about Git hooks in the *githooks* page of the Git documentation,
available at: https://git-scm.com/docs/githooks
If you are planning on contributing back to TF-A, there are some things you'll
want to know.
Alternatively, you can clone without the commit hook using:
TF-A is hosted by a `Gerrit Code Review`_ server. Gerrit requires that all
commits include a ``Change-Id`` footer, and this footer is typically
automatically generated by a Git hook installed by you, the developer.
If you have Node.js installed already, you can automatically install this hook,
along with any additional hooks and Javascript-based tooling that we use, by
running from within your newly-cloned repository:
.. code:: shell
git clone "https://review.trustedfirmware.org/TF-A/trusted-firmware-a"
npm install
If you have opted **not** to install Node.js, you can install the Gerrit hook
manually by running:
.. code:: shell
curl -Lo $(git rev-parse --git-dir)/hooks/commit-msg https://review.trustedfirmware.org/tools/hooks/commit-msg
chmod +x $(git rev-parse --git-dir)/hooks/commit-msg
You can read more about Git hooks in the *githooks* page of the Git
documentation, available `here <https://git-scm.com/docs/githooks>`_.
--------------
*Copyright (c) 2019, Arm Limited. All rights reserved.*
*Copyright (c) 2021, Arm Limited. All rights reserved.*
.. _Arm Developer website: https://developer.arm.com/open-source/gnu-toolchain/gnu-a/downloads
.. _Gerrit Code Review: https://www.gerritcodereview.com/
.. _Linaro Release Notes: https://community.arm.com/dev-platforms/w/docs/226/old-release-notes
.. _Linaro instructions: https://community.arm.com/dev-platforms/w/docs/304/arm-reference-platforms-deliverables
.. _Development Studio 5 (DS-5): https://developer.arm.com/products/software-development-tools/ds-5-development-studio