summaryrefslogtreecommitdiffstats
path: root/third_party/rust/jsparagus/.githooks/pre-commit
blob: 5ca77432b26579d003725bc5f8d6360dfc701673 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env bash
#
# Simplified commit hook to format the files which were changed in the current commit
#

printf "[pre-commit] rustfmt"

for file in $(git diff --name-only --cached); do
  if [ ${file: -3} == ".rs" ];  then
    rustfmt $file
  fi
done

exit 0