diff --git a/.hooks/pre-commit b/.hooks/pre-commit index b4d474c18..6cc5f0f97 100755 --- a/.hooks/pre-commit +++ b/.hooks/pre-commit @@ -30,7 +30,7 @@ printf "[pre_commit] rustfmt " for file in $(git diff --name-only --cached); do if [ ${file: -3} == ".rs" ]; then # first collect all the files that need reformatting - rustfmt --unstable-options --skip-children --write-mode=diff $file &>/dev/null + rustfmt --check $file &>/dev/null if [ $? != 0 ]; then problem_files+=($file) result=1 @@ -40,7 +40,7 @@ done # now reformat all the files that need reformatting for file in ${problem_files[@]}; do - rustfmt --unstable-options --skip-children --write-mode=overwrite $file + rustfmt $file done # and let the user know what just happened (and which files were affected) diff --git a/api/rustfmt.toml b/api/rustfmt.toml deleted file mode 100644 index 5e7f9e245..000000000 --- a/api/rustfmt.toml +++ /dev/null @@ -1,2 +0,0 @@ -hard_tabs = true -wrap_comments = true diff --git a/chain/rustfmt.toml b/chain/rustfmt.toml deleted file mode 100644 index 5e7f9e245..000000000 --- a/chain/rustfmt.toml +++ /dev/null @@ -1,2 +0,0 @@ -hard_tabs = true -wrap_comments = true diff --git a/core/rustfmt.toml b/core/rustfmt.toml deleted file mode 100644 index 5e7f9e245..000000000 --- a/core/rustfmt.toml +++ /dev/null @@ -1,2 +0,0 @@ -hard_tabs = true -wrap_comments = true diff --git a/keychain/rustfmt.toml b/keychain/rustfmt.toml deleted file mode 100644 index 5e7f9e245..000000000 --- a/keychain/rustfmt.toml +++ /dev/null @@ -1,2 +0,0 @@ -hard_tabs = true -wrap_comments = true diff --git a/p2p/rustfmt.toml b/p2p/rustfmt.toml deleted file mode 100644 index 5e7f9e245..000000000 --- a/p2p/rustfmt.toml +++ /dev/null @@ -1,2 +0,0 @@ -hard_tabs = true -wrap_comments = true diff --git a/pool/rustfmt.toml b/pool/rustfmt.toml deleted file mode 100644 index 5e7f9e245..000000000 --- a/pool/rustfmt.toml +++ /dev/null @@ -1,2 +0,0 @@ -hard_tabs = true -wrap_comments = true diff --git a/rustfmt.toml b/rustfmt.toml index 5e7f9e245..218e20321 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,2 +1 @@ hard_tabs = true -wrap_comments = true diff --git a/servers/rustfmt.toml b/servers/rustfmt.toml deleted file mode 100644 index 5e7f9e245..000000000 --- a/servers/rustfmt.toml +++ /dev/null @@ -1,2 +0,0 @@ -hard_tabs = true -wrap_comments = true diff --git a/store/rustfmt.toml b/store/rustfmt.toml deleted file mode 100644 index 5e7f9e245..000000000 --- a/store/rustfmt.toml +++ /dev/null @@ -1,2 +0,0 @@ -hard_tabs = true -wrap_comments = true diff --git a/wallet/rustfmt.toml b/wallet/rustfmt.toml deleted file mode 100644 index 5e7f9e245..000000000 --- a/wallet/rustfmt.toml +++ /dev/null @@ -1,2 +0,0 @@ -hard_tabs = true -wrap_comments = true