Skip to content

Instantly share code, notes, and snippets.

View amatracaru's full-sized avatar

Andrei Matracaru amatracaru

View GitHub Profile
@amatracaru
amatracaru / pre-commit
Last active November 30, 2021 14:14 — forked from simonauner/pre-commit
Format c# with dotnet-format with pre-commit hook
#!/bin/sh
# Modified from https://gist.github.com/simonauner/09d4e3241f26d2bd139261816e6c18f6
#
# This script finds the files that are about to be committed,
# and runs dotnet format on them before adding them back to staging
#
# install dotnet-format: dotnet tool install -g dotnet-format
# make sure installed dotnet tools are on your path:
# export PATH="$PATH:$HOME/.dotnet/tools/"
# copy to .git/hooks/pre-commit and make executable