From 54939b6c3d4c3faff218ecf805577c65510224e0 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 15 Aug 2026 11:25:56 +0200 Subject: [PATCH 1/2] Fix pre-commit hook failure when package source mapping is active The hook installs dotnet-format with --add-source, which NuGet rejects when packageSourceMapping is configured. The dotnet10-transport feed is already declared in NuGet.config; adding a dotnet-format mapping entry there lets the install succeed without --add-source. Assisted-by: Claude:claude-sonnet-4-6:GitHub Copilot --- BuildTools/pre-commit | 2 +- NuGet.config | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BuildTools/pre-commit b/BuildTools/pre-commit index e72109971..5d2522463 100755 --- a/BuildTools/pre-commit +++ b/BuildTools/pre-commit @@ -28,7 +28,7 @@ esac DOTNET_PATH="$DOTNET_CACHE_ROOT/ICSharpCode/ILSpy/dotnet-format-$DOTNET_FORMAT_VERSION" if [ ! -d "$DOTNET_PATH" ]; then echo "Downloading dotnet-format $DOTNET_FORMAT_VERSION..." - dotnet tool install --tool-path "$DOTNET_PATH" dotnet-format --version "$DOTNET_FORMAT_VERSION" --add-source "$DOTNET_FORMAT_SOURCE" + dotnet tool install --tool-path "$DOTNET_PATH" dotnet-format --version "$DOTNET_FORMAT_VERSION" fi DOTNET_FORMAT="$DOTNET_PATH/dotnet-format$EXE_SUFFIX" diff --git a/NuGet.config b/NuGet.config index 63c7aff7b..342195236 100644 --- a/NuGet.config +++ b/NuGet.config @@ -16,6 +16,7 @@ + From d1645f50c97d0d61d1508dfd2a9f0a179a3db873 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 15 Aug 2026 11:37:16 +0200 Subject: [PATCH 2/2] Reduce verbosity of commit hook. --- BuildTools/pre-commit | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BuildTools/pre-commit b/BuildTools/pre-commit index 5d2522463..4a133d6ac 100755 --- a/BuildTools/pre-commit +++ b/BuildTools/pre-commit @@ -36,11 +36,11 @@ DOTNET_FORMAT="$DOTNET_PATH/dotnet-format$EXE_SUFFIX" "$DOTNET_FORMAT" --version if [ "${1:-}" = "--format" ]; then # called via format.bat - "$DOTNET_FORMAT" whitespace --no-restore --verbosity detailed ILSpy.sln + "$DOTNET_FORMAT" whitespace --no-restore --verbosity normal ILSpy.sln elif git diff --quiet --ignore-submodules; then - "$DOTNET_FORMAT" whitespace --no-restore --verbosity detailed ILSpy.sln + "$DOTNET_FORMAT" whitespace --no-restore --verbosity normal ILSpy.sln git add -u -- \*\*.cs else echo Partial commit: only verifying formatting - exec "$DOTNET_FORMAT" whitespace --verify-no-changes --no-restore --verbosity detailed ILSpy.sln + exec "$DOTNET_FORMAT" whitespace --verify-no-changes --no-restore --verbosity normal ILSpy.sln fi