Browse Source

Merge pull request #4007 from icsharpcode/fix/nuget-format-source-mapping

Fix pre-commit hook failure when package source mapping is active
pull/3920/head
Daniel Grunwald 1 month ago committed by GitHub
parent
commit
09636aa8b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      BuildTools/pre-commit
  2. 1
      NuGet.config

8
BuildTools/pre-commit

@ -28,7 +28,7 @@ esac @@ -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"
@ -36,11 +36,11 @@ DOTNET_FORMAT="$DOTNET_PATH/dotnet-format$EXE_SUFFIX" @@ -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

1
NuGet.config

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
</packageSource>
<packageSource key="dotnet10-transport">
<package pattern="ILCompiler.Reflection.ReadyToRun.Experimental" />
<package pattern="dotnet-format" />
</packageSource>
<packageSource key="dotnet-tools">
<package pattern="Microsoft.DiaSymReader.Converter.Xml" />

Loading…
Cancel
Save