Skip to content

Commit 4cbf11a

Browse files
committed
deprecate config option skip_children
1 parent e3d0e1d commit 4cbf11a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Configurations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,7 @@ specific version of rustfmt is used in your CI, use this option.
18811881
- **Possible values**: any published version (e.g. `"0.3.8"`)
18821882
- **Stable**: No (tracking issue: #3386)
18831883

1884-
## `skip_children`
1884+
## `skip_children` (DEPRECATED #3587)
18851885

18861886
Don't reformat out of line modules
18871887

src/config/config_type.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ macro_rules! create_config {
5858

5959
use serde::{Deserialize, Serialize};
6060

61+
// for error messages
62+
use ansi_term::Colour::Red;
63+
6164
#[derive(Clone)]
6265
#[allow(unreachable_pub)]
6366
pub struct Config {
@@ -137,8 +140,16 @@ macro_rules! create_config {
137140
}
138141

139142
fn fill_from_parsed_config(mut self, parsed: PartialConfig, dir: &Path) -> Config {
143+
let deprecate_skip_children = || {
144+
let msg = "Option skip_children is deprecated since it is now the default to not format submodules of given files (#3587)";
145+
eprintln!("{}: {}", Red.bold().paint("Deprecation"), msg);
146+
};
147+
140148
$(
141149
if let Some(val) = parsed.$i {
150+
if stringify!($i) == "skip_children" {
151+
deprecate_skip_children()
152+
}
142153
if self.$i.3 {
143154
self.$i.1 = true;
144155
self.$i.2 = val;
@@ -216,6 +227,7 @@ macro_rules! create_config {
216227
match key {
217228
$(
218229
stringify!($i) => {
230+
dbg!(stringify!($i));
219231
self.$i.1 = true;
220232
self.$i.2 = val.parse::<$ty>()
221233
.expect(&format!("Failed to parse override for {} (\"{}\") as a {}",

0 commit comments

Comments
 (0)