From fa2eef0078823e033ae8b15b876a5012ed8beb0b Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Sun, 22 Feb 2026 06:31:38 +0100 Subject: [PATCH 1/3] Remove tabwidth= in .editorconfig tab_width: [...]. This defaults to the value of indent_size and doesn't usually need to be specified. (https://editorconfig.org/) --- .editorconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 8806648..a04228b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,5 +9,3 @@ trim_trailing_whitespace = true [*.nix] indent_size = 2 -tab_width = 2 - From e77a4ee4858a52a7d256086c3e69374429746479 Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Sun, 22 Feb 2026 06:33:09 +0100 Subject: [PATCH 2/3] Add .sh to .editorconfig --- .editorconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.editorconfig b/.editorconfig index a04228b..ef4e49d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,5 +7,9 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true +[*.sh] +indent_size = 2 + [*.nix] indent_size = 2 + From 4fe66154c3b5ba7b86b26712e35f521c2e8e4d7b Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Sun, 22 Feb 2026 06:34:38 +0100 Subject: [PATCH 3/3] Add a nix package --- flake.nix | 5 +++++ git-check-assertions.sh | 1 + 2 files changed, 6 insertions(+) diff --git a/flake.nix b/flake.nix index 36e54fa..588b7bc 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,11 @@ pkgs = nixpkgs.legacyPackages.${system}; in { + packages.default = pkgs.writeShellApplication { + name = "git-check-assertions"; + runtimeInputs = [ pkgs.git ]; + text = builtins.readFile ./git-check-assertions.sh; + }; devShells.default = pkgs.mkShell { packages = with pkgs; [ bats ]; }; diff --git a/git-check-assertions.sh b/git-check-assertions.sh index b0fe652..a023370 100755 --- a/git-check-assertions.sh +++ b/git-check-assertions.sh @@ -41,6 +41,7 @@ for commit_hash in "${commits[@]}"; do echo "Checking out $commit_hash" git -c advice.detachedHead=false checkout -q "$commit_hash" commit_msg="$(git log -1 --format=%B "$commit_hash")" + # shellcheck disable=SC2016 block="$(printf '%s\n' "$commit_msg" \ | sed -n '/^```git-check-assertions[[:space:]]*$/,/^```[[:space:]]*$/p' \ | sed '1d;$d')"