From ed88ad8bbc7a317084142227e99702e1490e3168 Mon Sep 17 00:00:00 2001 From: Antioch Peverell <30642645+antiochp@users.noreply.github.com> Date: Fri, 10 Aug 2018 14:54:09 +0100 Subject: [PATCH] cannot use unstable rustfmt features outside nightly toolchain (#1338) * cannot use unstable rustfmt features outside nightly toolchain * cleanup redundant rustfmt.toml files --- .hooks/pre-commit | 4 ++-- api/rustfmt.toml | 2 -- chain/rustfmt.toml | 2 -- core/rustfmt.toml | 2 -- keychain/rustfmt.toml | 2 -- p2p/rustfmt.toml | 2 -- pool/rustfmt.toml | 2 -- rustfmt.toml | 1 - servers/rustfmt.toml | 2 -- store/rustfmt.toml | 2 -- wallet/rustfmt.toml | 2 -- 11 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 api/rustfmt.toml delete mode 100644 chain/rustfmt.toml delete mode 100644 core/rustfmt.toml delete mode 100644 keychain/rustfmt.toml delete mode 100644 p2p/rustfmt.toml delete mode 100644 pool/rustfmt.toml delete mode 100644 servers/rustfmt.toml delete mode 100644 store/rustfmt.toml delete mode 100644 wallet/rustfmt.toml 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