From 60b7638882a2d90aebe21db5efe514b934971eda Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 15 Sep 2020 16:11:39 +0200 Subject: [PATCH] docs: introduce conventional-commits (#1234) --- COMMITS.md | 29 +++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 COMMITS.md diff --git a/COMMITS.md b/COMMITS.md new file mode 100644 index 000000000..1f986fc15 --- /dev/null +++ b/COMMITS.md @@ -0,0 +1,29 @@ +# Commits + +Using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) is strongly recommended and might be enforced in future. + +### Examples + +``` +docs: correct spelling of CHANGELOG +feat: allow provided config object to extend other configs +feat(lang): added polish language +``` + +### Git hook + +Use this git hook to auto-check your commit messages. Save the following snippet into `.git/hooks/commit-msg` + +``` +#!/bin/sh +if ! grep -qE "^(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert)(\((common|core|crypto|legacy|python|storage|tools|vendor)\))?: " "$1" ; then + echo "Conventional Commits validation failed" + exit 1 +fi +``` + +If you want to bypass commit-msg hook check, you may always use + +``` +git commit -m "foobar" --no-verify +``` diff --git a/README.md b/README.md index bcc1d6646..7404fd5d3 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ See [CONTRIBUTING.md](docs/misc/contributing.md). +Using [Conventional Commits](COMMITS.md) is strongly recommended and might be enforced in future. + Also please have a look at the docs, either in the `docs` folder or at [docs.trezor.io](https://docs.trezor.io) before contributing. The [misc](docs/misc/index.md) chapter should be read in particular because it contains some useful assorted knowledge. ## Security vulnerability disclosure