From 73060b49720ce165bd7d0a087ecae98ad104e25a 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 c44e5134c..208296194 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 77a83860223bbcfd53b2cae3ad3e650a9cc7c157 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 f43168eb2..e02d8b297 --- 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 414c346560de1235119bce25da60fd68353d5ebf 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 efacaba59..e1ef75c41 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 "we don't know whether we built the manpages, so we can't reliably test them here." # test help output @@ -74,5 +74,3 @@ nix-daemon --help nix-hash --help nix-instantiate --help nix-prefetch-url --help - -fi