Skip to content

Commit 4a67e13

Browse files
Remove warning on explicit default config value in tests
This was added with f7a25a1, this was to address an issue with the worthy goal[1]: > It is probably worth auditing the tests and where they are not deliberately testing an option, removing any options they set. However, given the number of warnings this produces: $ cargo test -- --nocapture |& grep -c 'Default value.*used explicitly' 236 I think this approach did not work, one could enforce this approach by changing this to be an error, but I think there are valid cases to use defaults, e.g. a reproduction of an issue relating to line length uses the default `max_width`: it's simplest to add a test verifying the behaviour with an explicit `max_width: 100` rather than adjusting the reproduction. Link: #1720 [1]
1 parent 8636436 commit 4a67e13

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/test/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::{
1919
};
2020

2121
use rustfmt_config_proc_macro::nightly_only_test;
22-
use tracing::{debug, warn};
22+
use tracing::debug;
2323

2424
mod configuration_snippet;
2525
mod mod_resolver;
@@ -776,9 +776,6 @@ fn read_config(filename: &Path) -> Config {
776776
for (key, val) in &sig_comments {
777777
if key != "target" && key != "config" && key != "unstable" {
778778
config.override_value(key, val);
779-
if config.is_default(key) {
780-
warn!("Default value {} used explicitly for {}", val, key);
781-
}
782779
}
783780
}
784781

0 commit comments

Comments
 (0)