From 9fb850705638d9882e91e8dfdd0430652cffc5ef Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Sun, 22 Feb 2026 07:07:10 +0100 Subject: [PATCH 1/2] git-check-assertions.sh -> git-check-assertions --- .editorconfig | 2 +- flake.nix | 2 +- git-check-assertions.sh => git-check-assertions | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename git-check-assertions.sh => git-check-assertions (100%) diff --git a/.editorconfig b/.editorconfig index ef4e49d..8d5b7df 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,7 +7,7 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -[*.sh] +[git-check-assertions] indent_size = 2 [*.nix] diff --git a/flake.nix b/flake.nix index 588b7bc..ec37673 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,7 @@ packages.default = pkgs.writeShellApplication { name = "git-check-assertions"; runtimeInputs = [ pkgs.git ]; - text = builtins.readFile ./git-check-assertions.sh; + text = builtins.readFile ./git-check-assertions; }; devShells.default = pkgs.mkShell { packages = with pkgs; [ bats ]; diff --git a/git-check-assertions.sh b/git-check-assertions similarity index 100% rename from git-check-assertions.sh rename to git-check-assertions From 144ef949cfe2d9b618fc6e5034d5103b1835b96f Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Sun, 22 Feb 2026 07:07:26 +0100 Subject: [PATCH 2/2] Add test.bats --- .editorconfig | 3 +++ test.bats | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100755 test.bats diff --git a/.editorconfig b/.editorconfig index 8d5b7df..2909bf8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,6 +10,9 @@ trim_trailing_whitespace = true [git-check-assertions] indent_size = 2 +[*.bats] +indent_size = 2 + [*.nix] indent_size = 2 diff --git a/test.bats b/test.bats new file mode 100755 index 0000000..48965fd --- /dev/null +++ b/test.bats @@ -0,0 +1,10 @@ +#!/usr/bin/env bats + +setup() { + DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )" + PATH="$DIR:$PATH" +} + +@test "can run" { + git-check-assertions +}