From e9c8e3b35eca32b1d93be4009e9308b99a9b2380 Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Tue, 3 Mar 2026 07:07:28 +0100 Subject: [PATCH] Use bats.withLibraries instead of submodules --- .gitmodules | 9 --------- README.md | 2 +- default.nix | 6 +++++- flake.nix | 10 +++++++--- test/git-check-assertions.bats | 6 +++--- test/test_helper/bats-assert | 1 - test/test_helper/bats-file | 1 - test/test_helper/bats-support | 1 - 8 files changed, 16 insertions(+), 20 deletions(-) delete mode 100644 .gitmodules delete mode 160000 test/test_helper/bats-assert delete mode 160000 test/test_helper/bats-file delete mode 160000 test/test_helper/bats-support diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 9ec278b..0000000 --- a/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "test/test_helper/bats-support"] - path = test/test_helper/bats-support - url = https://github.com/bats-core/bats-support.git -[submodule "test/test_helper/bats-assert"] - path = test/test_helper/bats-assert - url = https://github.com/bats-core/bats-assert.git -[submodule "test/test_helper/bats-file"] - path = test/test_helper/bats-file - url = https://github.com/bats-core/bats-file.git diff --git a/README.md b/README.md index 01c4cb6..79ff8de 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ You include a small bash script inside your commit messages, and `git-check-asse ## Building ```bash -nix build .?submodules=1 +nix build . ``` ## Examples of commit messages diff --git a/default.nix b/default.nix index a956baf..d8055a8 100644 --- a/default.nix +++ b/default.nix @@ -33,7 +33,11 @@ resholve.mkDerivation { nativeCheckInputs = [ shellcheck-minimal - bats + (bats.withLibraries (p: [ + p.bats-assert + p.bats-support + p.bats-file + ])) gitMinimal shfmt ]; diff --git a/flake.nix b/flake.nix index 60198ee..e82af69 100644 --- a/flake.nix +++ b/flake.nix @@ -16,9 +16,13 @@ { packages.default = pkgs.callPackage ./default.nix { }; devShells.default = pkgs.mkShell { - packages = with pkgs; [ - bats - shfmt + packages = [ + (pkgs.bats.withLibraries (p: [ + p.bats-assert + p.bats-support + p.bats-file + ])) + pkgs.shfmt ]; }; } diff --git a/test/git-check-assertions.bats b/test/git-check-assertions.bats index 0b0b0e1..f58c3ea 100755 --- a/test/git-check-assertions.bats +++ b/test/git-check-assertions.bats @@ -3,9 +3,9 @@ setup() { set -euo pipefail - load 'test_helper/bats-support/load' - load 'test_helper/bats-assert/load' - load 'test_helper/bats-file/load' + bats_load_library bats-support + bats_load_library bats-assert + bats_load_library bats-file DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")" >/dev/null 2>&1 && pwd)" PATH="$DIR/../bin:$PATH" diff --git a/test/test_helper/bats-assert b/test/test_helper/bats-assert deleted file mode 160000 index 697471b..0000000 --- a/test/test_helper/bats-assert +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 697471b7a89d3ab38571f38c6c7c4b460d1f5e35 diff --git a/test/test_helper/bats-file b/test/test_helper/bats-file deleted file mode 160000 index 6bee58b..0000000 --- a/test/test_helper/bats-file +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6bee58bec7c2f4aed1a7425ccd4bdc42b4a84599 diff --git a/test/test_helper/bats-support b/test/test_helper/bats-support deleted file mode 160000 index 0954abb..0000000 --- a/test/test_helper/bats-support +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0954abb9925cad550424cebca2b99255d4eabe96