Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate --backup option #3902

Merged
merged 2 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2442,10 +2442,6 @@ Break comments to fit on the line

Internal option

## `make_backup`

Internal option, use `--backup`

## `print_misformatted_file_names`

Internal option, use `-l` or `--files-with-diff`
9 changes: 0 additions & 9 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ fn make_opts() -> Options {
"[files|stdout]"
};
opts.optopt("", "emit", "What data to emit and how", emit_opts);
opts.optflag("", "backup", "Backup any modified files.");
opts.optopt(
"",
"config-path",
Expand Down Expand Up @@ -505,7 +504,6 @@ struct GetOptsOptions {
config_path: Option<PathBuf>,
inline_config: HashMap<String, String>,
emit_mode: Option<EmitMode>,
backup: bool,
check: bool,
edition: Option<Edition>,
color: Option<Color>,
Expand Down Expand Up @@ -607,10 +605,6 @@ impl GetOptsOptions {
options.edition = Some(edition_from_edition_str(edition_str)?);
}

if matches.opt_present("backup") {
options.backup = true;
}

if matches.opt_present("files-with-diff") {
options.print_misformatted_file_names = true;
}
Expand Down Expand Up @@ -674,9 +668,6 @@ impl CliOptions for GetOptsOptions {
} else if let Some(emit_mode) = self.emit_mode {
config.set().emit_mode(emit_mode);
}
if self.backup {
config.set().make_backup(true);
}
if let Some(color) = self.color {
config.set().color(color);
}
Expand Down
2 changes: 0 additions & 2 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ create_config! {
"'small' heuristic values";
emit_mode: EmitMode, EmitMode::Files, false,
"What emit Mode to use when none is supplied";
make_backup: bool, false, false, "Backup changed files";
print_misformatted_file_names: bool, false, true,
"Prints the names of mismatched files that were formatted. Prints the names of \
files that would be formated when used with `--check` mode. ";
Expand Down Expand Up @@ -552,7 +551,6 @@ report_todo = "Never"
report_fixme = "Never"
ignore = []
emit_mode = "Files"
make_backup = false
"#,
env!("CARGO_PKG_VERSION")
);
Expand Down
2 changes: 0 additions & 2 deletions src/emitter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub(crate) use self::checkstyle::*;
pub(crate) use self::diff::*;
pub(crate) use self::files::*;
pub(crate) use self::files_with_backup::*;
pub(crate) use self::json::*;
pub(crate) use self::modified_lines::*;
pub(crate) use self::stdout::*;
Expand All @@ -12,7 +11,6 @@ use std::path::Path;
mod checkstyle;
mod diff;
mod files;
mod files_with_backup;
mod json;
mod modified_lines;
mod stdout;
Expand Down
31 changes: 0 additions & 31 deletions src/emitter/files_with_backup.rs

This file was deleted.

3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,6 @@ impl<'b, T: Write + 'b> Session<'b, T> {

pub(crate) fn create_emitter<'a>(config: &Config) -> Box<dyn Emitter + 'a> {
match config.emit_mode() {
EmitMode::Files if config.make_backup() => {
Box::new(emitter::FilesWithBackupEmitter::default())
}
EmitMode::Files => Box::new(emitter::FilesEmitter::new(
config.print_misformatted_file_names(),
)),
Expand Down