Merge pull request 'Package with nix' (#1) from package into main

Reviewed-on: https://codeberg.org/svenvanheugten/git-check-assertions/pulls/1
This commit is contained in:
Sven van Heugten 2026-02-22 06:49:16 +01:00
commit 8ac30906df
3 changed files with 9 additions and 1 deletions

View file

@ -7,7 +7,9 @@ end_of_line = lf
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.sh]
indent_size = 2
[*.nix] [*.nix]
indent_size = 2 indent_size = 2
tab_width = 2

View file

@ -14,6 +14,11 @@
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in in
{ {
packages.default = pkgs.writeShellApplication {
name = "git-check-assertions";
runtimeInputs = [ pkgs.git ];
text = builtins.readFile ./git-check-assertions.sh;
};
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
packages = with pkgs; [ bats ]; packages = with pkgs; [ bats ];
}; };

View file

@ -41,6 +41,7 @@ for commit_hash in "${commits[@]}"; do
echo "Checking out $commit_hash" echo "Checking out $commit_hash"
git -c advice.detachedHead=false checkout -q "$commit_hash" git -c advice.detachedHead=false checkout -q "$commit_hash"
commit_msg="$(git log -1 --format=%B "$commit_hash")" commit_msg="$(git log -1 --format=%B "$commit_hash")"
# shellcheck disable=SC2016
block="$(printf '%s\n' "$commit_msg" \ block="$(printf '%s\n' "$commit_msg" \
| sed -n '/^```git-check-assertions[[:space:]]*$/,/^```[[:space:]]*$/p' \ | sed -n '/^```git-check-assertions[[:space:]]*$/,/^```[[:space:]]*$/p' \
| sed '1d;$d')" | sed '1d;$d')"