Skip to content

Instantly share code, notes, and snippets.

View simonauner's full-sized avatar

Simon Auner simonauner

View GitHub Profile
@simonauner
simonauner / pre-commit
Last active September 9, 2023 16:42 — forked from EtherZa/pre-commit
Format c# with dotnet-format with pre-commit hook
#!/bin/sh
# Modified from https://gist.github.com/EtherZa/581d9276336353838b2c939f9554d479
#
# 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