From bf31640f49cb115508c31bf3bd0b4b80bb8ab71d Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Tue, 23 Jan 2024 21:06:14 +0000 Subject: [PATCH] doc: specify commit message format I've noticed quite a few pull requests are being submitted with formats such as feat(abc): or target: at the start of the message. It will be helpful to have a specific format for this to keep things consistent. --- CONTRIBUTING.md | 36 ++++++++++++++++++++++++++++++++++++ docs/default.nix | 1 + docs/src/SUMMARY.md | 1 + 3 files changed, 38 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..693d0717 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,36 @@ +# Contributing to Stylix + +## Commit messages + +To keep things consistent, commit messages should follow a format +[similar to Nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#commit-conventions): + +``` +«scope»: «summary» + +«motivation for change» +``` + +Where the scope is one of: + +| Scope | Purpose | +|----------------|------------------------------------------------------------------------| +| `doc` | Changes to the website, `README.md`, and so on. | +| `stylix` | Changes in the `stylix` directory, `flake.nix`, and other global code. | +| Name of target | Changes to code for a particular target. | +| `treewide` | Changes across many targets. | + +The scope is meant to indicate which area of the code was changed. Specifying +the type of change, such as `feat` or `fix`, is not necessary. Dependency +updates should use whichever scope they are related to. + +The summary should start with a lowercase letter, and should not end with +punctuation. + +Most commits to `master` will also include a pull request number in brackets +after the summary. GitHub adds this automatically when creating a squash merge. + +### Old commits + +Commits before 2024 did not follow any particular format. +Some have emojis from [GitMoji](https://gitmoji.dev). diff --git a/docs/default.nix b/docs/default.nix index 9e95d4c0..e20d7e45 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -43,6 +43,7 @@ in pkgs.stdenvNoCC.mkDerivation { patchPhase = '' cp ${../README.md} src/README.md + cp ${../CONTRIBUTING.md} src/contributing.md # The "declared by" links point to a file which only exists when the docs # are built locally. This removes the links. diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index f1c21222..46f8b062 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -13,5 +13,6 @@ # Contributing +- [Contributing](contributing.md) - [Adding modules](modules.md) - [Style guide](styling.md)