aboutsummaryrefslogtreecommitdiff
path: root/misc/pre-commit.nix
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-05-22 21:18:02 +0200
committereldritch horrors <pennae@lix.systems>2024-05-23 02:09:05 +0000
commit9a75150d19dab87a3e2cbd636397b9561eb98ad4 (patch)
tree285b562a72c85fb5dcd9793cb48ed9d1c95a8bab /misc/pre-commit.nix
parentd05e0b9f1fedfe1700959cc6045ce9bc25b9e955 (diff)
doc: sort change-authors.yml
this should make it easier to spot future instances of entries being duplicated by accident. also add a pre-commit check to remain sorted Change-Id: I500caf862e93480b38c9d51144273bb2dcab1af0
Diffstat (limited to 'misc/pre-commit.nix')
-rw-r--r--misc/pre-commit.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/misc/pre-commit.nix b/misc/pre-commit.nix
index ea39bc21d..ed2b152a3 100644
--- a/misc/pre-commit.nix
+++ b/misc/pre-commit.nix
@@ -66,6 +66,18 @@ pre-commit-run {
${lib.getExe pkgs.build-release-notes} --change-authors doc/manual/change-authors.yml doc/manual/rl-next doc/manual/rl-next-dev
'';
};
+ change-authors-sorted = {
+ enable = true;
+ package = pkgs.yq;
+ files = ''^doc/manual/change-authors\.yml'';
+ entry = "${pkgs.writeShellScript "change-authors-sorted" ''
+ set -euo pipefail
+ shopt -s inherit_errexit
+
+ echo "changes necessary to sort $1:"
+ diff -U3 <(${lib.getExe pkgs.yq} -y . "$1") <(${lib.getExe pkgs.yq} -Sy . "$1")
+ ''}";
+ };
check-headers = {
enable = true;
package = pkgs.check-headers;