From f147c9ea16e241c618f5af5f737585cec7b0cdeb Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 24 Jan 2025 16:37:09 +0100 Subject: [PATCH 1/3] pre-commit/check-merge-conflicts-2: fix use outside dev shell Note that this is just a script that is meant to run outside a derivation (but also can be called by a derivation builder). `touch $out` does not belong in it. `touch $out` worked accidentally in the derivation-based check, and also in the dev shell, but if pre-commit is invoked without the dev shell it would fail. --- maintainers/flake-module.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/maintainers/flake-module.nix b/maintainers/flake-module.nix index c44e5134c8a..208296194a1 100644 --- a/maintainers/flake-module.nix +++ b/maintainers/flake-module.nix @@ -35,7 +35,6 @@ echo "ERROR: found merge/patch conflicts in files" exit 1 fi - touch $out ''}"; }; nixfmt-rfc-style = { From fd63e562aac227c94f2d5db0f163ec943f09d2e9 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 29 Jan 2025 21:53:12 +0100 Subject: [PATCH 2/3] test: Fix shellcheck by giving git-hashing scripts shebangs This seems to be the way to do it now, even though I can't run them without setting at least one env var. I'll only fix shellcheck for now. Don't shoot the messenger. It isn't quite clear to me why the previous commit masked this problem, but I'm glad shellcheck has an effect or more effect now. --- tests/functional/git-hashing/fixed.sh | 0 tests/functional/git-hashing/simple.sh | 2 ++ 2 files changed, 2 insertions(+) mode change 100644 => 100755 tests/functional/git-hashing/fixed.sh mode change 100644 => 100755 tests/functional/git-hashing/simple.sh diff --git a/tests/functional/git-hashing/fixed.sh b/tests/functional/git-hashing/fixed.sh old mode 100644 new mode 100755 diff --git a/tests/functional/git-hashing/simple.sh b/tests/functional/git-hashing/simple.sh old mode 100644 new mode 100755 index f43168eb214..e02d8b29761 --- a/tests/functional/git-hashing/simple.sh +++ b/tests/functional/git-hashing/simple.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + source common.sh repo="$TEST_ROOT/scratch" From 11962d3a0cdc62f2aa173b5dbe95e09e7b17f0bf Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 29 Jan 2025 22:01:17 +0100 Subject: [PATCH 3/3] test: Use skipTest instead of exit 0 This way shellcheck is ok with it, and it conveys that a significant chunk of the test is skipped. --- tests/functional/help.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/functional/help.sh b/tests/functional/help.sh index efacaba5922..6c0f168e460 100755 --- a/tests/functional/help.sh +++ b/tests/functional/help.sh @@ -25,7 +25,7 @@ done # FIXME: we don't know whether we built the manpages, so we can't # reliably test them here. -if false; then +skipTest # test help output @@ -74,5 +74,3 @@ nix-daemon --help nix-hash --help nix-instantiate --help nix-prefetch-url --help - -fi