From 60ed5e912b399e24d43be428eb7dee5422c3c6b4 Mon Sep 17 00:00:00 2001 From: bradleypmartin Date: Sun, 26 Apr 2020 22:33:33 -0600 Subject: [PATCH 1/3] add recursive mode and clean up whitelist where we can --- rustfmt-core/rustfmt-lib/src/test/mod.rs | 13 +------------ rustfmt-core/rustfmt-lib/tests/source/cfg_if/lib.rs | 1 + rustfmt-core/rustfmt-lib/tests/target/cfg_if/lib.rs | 1 + 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/rustfmt-core/rustfmt-lib/src/test/mod.rs b/rustfmt-core/rustfmt-lib/src/test/mod.rs index d5af64292bd..1d7608394c8 100644 --- a/rustfmt-core/rustfmt-lib/src/test/mod.rs +++ b/rustfmt-core/rustfmt-lib/src/test/mod.rs @@ -21,21 +21,10 @@ const DIFF_CONTEXT_SIZE: usize = 3; // A list of files on which we want to skip testing. const SKIP_FILE_WHITE_LIST: &[&str] = &[ + "issue-3253/paths", "issue-3434/no_entry.rs", "issue-3665/sub_mod.rs", - // Testing for issue-3779 "issue-3779/ice.rs", - // These files and directory are a part of modules defined inside `cfg_if!`. - "cfg_if/mod.rs", - "cfg_if/detect", - "issue-3253/foo.rs", - "issue-3253/bar.rs", - "issue-3253/paths", - // These files and directory are a part of modules defined inside `cfg_attr(..)`. - "cfg_mod/dir", - "cfg_mod/bar.rs", - "cfg_mod/foo.rs", - "cfg_mod/wasm32.rs", // We want to ensure `recursive` is working correctly, so do not test // these files directly "configs/recursive/disabled/foo.rs", diff --git a/rustfmt-core/rustfmt-lib/tests/source/cfg_if/lib.rs b/rustfmt-core/rustfmt-lib/tests/source/cfg_if/lib.rs index 8b3bb304f1c..bb333be01a9 100644 --- a/rustfmt-core/rustfmt-lib/tests/source/cfg_if/lib.rs +++ b/rustfmt-core/rustfmt-lib/tests/source/cfg_if/lib.rs @@ -10,6 +10,7 @@ //! * `mips64`: [`is_mips64_feature_detected`] //! * `powerpc`: [`is_powerpc_feature_detected`] //! * `powerpc64`: [`is_powerpc64_feature_detected`] +// rustfmt-recursive: true #![unstable(feature = "stdsimd", issue = "27731")] #![feature(const_fn, staged_api, stdsimd, doc_cfg, allow_internal_unstable)] diff --git a/rustfmt-core/rustfmt-lib/tests/target/cfg_if/lib.rs b/rustfmt-core/rustfmt-lib/tests/target/cfg_if/lib.rs index 8b3bb304f1c..bb333be01a9 100644 --- a/rustfmt-core/rustfmt-lib/tests/target/cfg_if/lib.rs +++ b/rustfmt-core/rustfmt-lib/tests/target/cfg_if/lib.rs @@ -10,6 +10,7 @@ //! * `mips64`: [`is_mips64_feature_detected`] //! * `powerpc`: [`is_powerpc_feature_detected`] //! * `powerpc64`: [`is_powerpc64_feature_detected`] +// rustfmt-recursive: true #![unstable(feature = "stdsimd", issue = "27731")] #![feature(const_fn, staged_api, stdsimd, doc_cfg, allow_internal_unstable)] From 3f40a9e275b97393df4848dbeb34983de7ef351e Mon Sep 17 00:00:00 2001 From: bradleypmartin Date: Mon, 27 Apr 2020 21:44:55 -0600 Subject: [PATCH 2/3] move recursive setting to top of lib.rs files --- rustfmt-core/rustfmt-lib/tests/source/cfg_if/lib.rs | 3 ++- rustfmt-core/rustfmt-lib/tests/target/cfg_if/lib.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rustfmt-core/rustfmt-lib/tests/source/cfg_if/lib.rs b/rustfmt-core/rustfmt-lib/tests/source/cfg_if/lib.rs index bb333be01a9..17e76286a61 100644 --- a/rustfmt-core/rustfmt-lib/tests/source/cfg_if/lib.rs +++ b/rustfmt-core/rustfmt-lib/tests/source/cfg_if/lib.rs @@ -1,3 +1,5 @@ +// rustfmt-recursive: true + //! Run-time feature detection for the Rust standard library. //! //! To detect whether a feature is enabled in the system running the binary @@ -10,7 +12,6 @@ //! * `mips64`: [`is_mips64_feature_detected`] //! * `powerpc`: [`is_powerpc_feature_detected`] //! * `powerpc64`: [`is_powerpc64_feature_detected`] -// rustfmt-recursive: true #![unstable(feature = "stdsimd", issue = "27731")] #![feature(const_fn, staged_api, stdsimd, doc_cfg, allow_internal_unstable)] diff --git a/rustfmt-core/rustfmt-lib/tests/target/cfg_if/lib.rs b/rustfmt-core/rustfmt-lib/tests/target/cfg_if/lib.rs index bb333be01a9..17e76286a61 100644 --- a/rustfmt-core/rustfmt-lib/tests/target/cfg_if/lib.rs +++ b/rustfmt-core/rustfmt-lib/tests/target/cfg_if/lib.rs @@ -1,3 +1,5 @@ +// rustfmt-recursive: true + //! Run-time feature detection for the Rust standard library. //! //! To detect whether a feature is enabled in the system running the binary @@ -10,7 +12,6 @@ //! * `mips64`: [`is_mips64_feature_detected`] //! * `powerpc`: [`is_powerpc_feature_detected`] //! * `powerpc64`: [`is_powerpc64_feature_detected`] -// rustfmt-recursive: true #![unstable(feature = "stdsimd", issue = "27731")] #![feature(const_fn, staged_api, stdsimd, doc_cfg, allow_internal_unstable)] From 009421c5343f3f2da963cb1cf155a27ddf2d823d Mon Sep 17 00:00:00 2001 From: bradleypmartin Date: Tue, 28 Apr 2020 08:36:30 -0600 Subject: [PATCH 3/3] rustfmt-core/rustfmt-lib/src/test/mod.rs : revert skipped files --- rustfmt-core/rustfmt-lib/src/test/mod.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rustfmt-core/rustfmt-lib/src/test/mod.rs b/rustfmt-core/rustfmt-lib/src/test/mod.rs index 1d7608394c8..d5af64292bd 100644 --- a/rustfmt-core/rustfmt-lib/src/test/mod.rs +++ b/rustfmt-core/rustfmt-lib/src/test/mod.rs @@ -21,10 +21,21 @@ const DIFF_CONTEXT_SIZE: usize = 3; // A list of files on which we want to skip testing. const SKIP_FILE_WHITE_LIST: &[&str] = &[ - "issue-3253/paths", "issue-3434/no_entry.rs", "issue-3665/sub_mod.rs", + // Testing for issue-3779 "issue-3779/ice.rs", + // These files and directory are a part of modules defined inside `cfg_if!`. + "cfg_if/mod.rs", + "cfg_if/detect", + "issue-3253/foo.rs", + "issue-3253/bar.rs", + "issue-3253/paths", + // These files and directory are a part of modules defined inside `cfg_attr(..)`. + "cfg_mod/dir", + "cfg_mod/bar.rs", + "cfg_mod/foo.rs", + "cfg_mod/wasm32.rs", // We want to ensure `recursive` is working correctly, so do not test // these files directly "configs/recursive/disabled/foo.rs",