mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +03:00
commit (#1324)
This commit is contained in:
parent
414a30224e
commit
e383cb594f
1 changed files with 2 additions and 2 deletions
|
@ -30,7 +30,7 @@ printf "[pre_commit] rustfmt "
|
||||||
for file in $(git diff --name-only --cached); do
|
for file in $(git diff --name-only --cached); do
|
||||||
if [ ${file: -3} == ".rs" ]; then
|
if [ ${file: -3} == ".rs" ]; then
|
||||||
# first collect all the files that need reformatting
|
# first collect all the files that need reformatting
|
||||||
rustfmt --skip-children --write-mode=diff $file &>/dev/null
|
rustfmt --unstable-options --skip-children --write-mode=diff $file &>/dev/null
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
problem_files+=($file)
|
problem_files+=($file)
|
||||||
result=1
|
result=1
|
||||||
|
@ -40,7 +40,7 @@ done
|
||||||
|
|
||||||
# now reformat all the files that need reformatting
|
# now reformat all the files that need reformatting
|
||||||
for file in ${problem_files[@]}; do
|
for file in ${problem_files[@]}; do
|
||||||
rustfmt --skip-children --write-mode=overwrite $file
|
rustfmt --unstable-options --skip-children --write-mode=overwrite $file
|
||||||
done
|
done
|
||||||
|
|
||||||
# and let the user know what just happened (and which files were affected)
|
# and let the user know what just happened (and which files were affected)
|
||||||
|
|
Loading…
Reference in a new issue