From fc377f3fb0ea33fc669dd4b99de412c74db06725 Mon Sep 17 00:00:00 2001 From: Chris Emerson Date: Sat, 20 Jan 2018 20:23:25 +0000 Subject: [PATCH 1/6] Add a new get_modified_lines() API to get only the new changed lines from rustfmting. Squashed commit of the following: commit e90f9da64bbdb640b8c9ee61c3ad395617d8b4da Author: Chris Emerson Date: Sat Jan 20 20:10:16 2018 +0000 Fix tests after merging with master. commit c3af0042769fe459b0c9c94a0934605ea4b40e40 Merge: 03868583 e0e3e222 Author: Chris Emerson Date: Sat Jan 20 17:45:05 2018 +0000 Merge remote-tracking branch 'origin/master' into HEAD commit 03868583f8555aae30bdfb5839a82afd3704f4cb Author: Chris Emerson Date: Mon Nov 20 01:57:56 2017 +0000 Fix some warnings. commit 162b13463e44c782394d418db5ca5710931beb7a Author: Chris Emerson Date: Mon Nov 20 01:48:02 2017 +0000 Remove unneeded import. commit 20cce3cbfd0f386d92b80bf4c7b83ab4d78a73e7 Merge: 81e98147 fa794f58 Author: Chris Emerson Date: Mon Nov 20 01:07:17 2017 +0000 Merge branch 'master' into difflines_mode commit 81e981472ceb3a0938d6f050edf8dcd5ebff8e33 Author: Chris Emerson Date: Mon Nov 20 01:02:50 2017 +0000 Add a simple "modified lines" test. commit 018390ced3523ca9fdd5384a6c1004cdb99174a9 Author: Chris Emerson Date: Thu Nov 2 23:06:21 2017 +0000 Update test output. commit 7909f4986ed21999aff7b3d075332e686ac464ff Author: Chris Emerson Date: Thu Nov 2 23:03:22 2017 +0000 Rerun rustfmt. commit 6275f1a8da52db1df36c4b7432996cdbb94ca463 Merge: 7a66d286 175c0c6f Author: Chris Emerson Date: Thu Nov 2 21:40:29 2017 +0000 Merge remote-tracking branch 'origin/master' into difflines_mode commit 7a66d2866432c430b046938bb37bf5efc03fa9da Author: Chris Emerson Date: Thu Nov 2 21:36:40 2017 +0000 WIP: Add a separate API to get changed lines. Currently calls format_input() and adjusts the output. commit c8163a923c7d9ae42fd8078cd9b2b51c6f73e36e Author: Chris Emerson Date: Fri Oct 27 22:53:33 2017 +0100 Remove "modified" from the documentation again. commit 94041fa115a6f428afe40e01d41bf2fe603f70bb Merge: acaa3c7c 2adf7eec Author: Chris Emerson Date: Fri Oct 27 22:47:05 2017 +0100 Merge branch 'master' into difflines_mode commit acaa3c7ce446297cd3fe5c9610763629a2d8537c Author: Chris Emerson Date: Tue Oct 24 23:34:14 2017 +0100 Update the Modified write mode to use `out` instead of just prinln!(). This means we can test it more easily, so do so. commit 9f1bbca1f3c12d933ea823918cc548e69b438b1e Author: Chris Emerson Date: Tue Oct 24 23:11:55 2017 +0100 Add "Modified" to the various lists of modes. commit e12f023756cf3daf202dcaa02bd6492b0d2a0455 Author: Chris Emerson Date: Tue Oct 24 22:57:33 2017 +0100 Rerun cargo fmt. commit 0f8a43630fa1548e95dcb1c0933708f9c11ae135 Author: Chris Emerson Date: Tue Oct 24 22:46:26 2017 +0100 Add `line_number_orig` to instances of `Mismatch` in tests. commit d432a7061f74dbc159584f08470c64985a4b41d9 Author: Chris Emerson Date: Tue Oct 24 22:41:40 2017 +0100 Add a `line_number_orig` field to `Mismatch` to track the pre-format line number. Use that for the write-mode=modified output. commit bdb7d1d23f02f7b8f18e7073a65be88ff94cdbb3 Author: Chris Emerson Date: Tue Oct 24 22:35:50 2017 +0100 First basic --write-mode=modified implementation. commit ea1433dae0c32879a31182c11be08b1bf53fbf31 Author: Chris Emerson Date: Fri Oct 20 00:04:16 2017 +0100 WIP on new "modified" mode. commit 27ee9483cf937a11a0e115f54de0afcc3f9ceb44 Merge: e48dd81a 2a84352d Author: Chris Emerson Date: Tue Oct 24 21:56:44 2017 +0100 Merge remote-tracking branch 'jc/diff_zero_context' into difflines_mode --- Configurations.md | 2 +- src/config.rs | 6 ++- src/filemap.rs | 11 ++++- src/lib.rs | 63 +++++++++++++++++++++++++++- src/rustfmt_diff.rs | 64 +++++++++++++++++++++++++++-- tests/system.rs | 26 ++++++++++++ tests/writemode/source/modified.rs | 14 +++++++ tests/writemode/target/modified.txt | 5 +++ 8 files changed, 182 insertions(+), 9 deletions(-) create mode 100644 tests/writemode/source/modified.rs create mode 100644 tests/writemode/target/modified.txt diff --git a/Configurations.md b/Configurations.md index 1b9c13ae39d3..bc4573b0ef86 100644 --- a/Configurations.md +++ b/Configurations.md @@ -1766,7 +1766,7 @@ See also: [`match_block_trailing_comma`](#match_block_trailing_comma). What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage - **Default value**: `"Overwrite"` -- **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"` +- **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`, `"Modified"` - **Stable**: No ## `blank_lines_upper_bound` diff --git a/src/config.rs b/src/config.rs index 954858b93a6d..db7c32537f29 100644 --- a/src/config.rs +++ b/src/config.rs @@ -128,6 +128,8 @@ configuration_option_enum! { WriteMode: Plain, // Outputs a checkstyle XML file. Checkstyle, + // Output the changed lines + Modified, } configuration_option_enum! { Color: @@ -298,7 +300,7 @@ macro_rules! create_config { // Macro hygiene won't allow us to make `set_$i()` methods on Config // for each item, so this struct is used to give the API to set values: - // `config.get().option(false)`. It's pretty ugly. Consider replacing + // `config.set().option(false)`. It's pretty ugly. Consider replacing // with `config.set_option(false)` if we ever get a stable/usable // `concat_idents!()`. pub struct ConfigSetter<'a>(&'a mut Config); @@ -677,7 +679,7 @@ create_config! { // Control options (changes the operation of rustfmt, rather than the formatting) write_mode: WriteMode, WriteMode::Overwrite, false, "What Write Mode to use when none is supplied: \ - Replace, Overwrite, Display, Plain, Diff, Coverage"; + Replace, Overwrite, Display, Plain, Diff, Coverage, Modified"; color: Color, Color::Auto, false, "What Color option to use when none is supplied: Always, Never, Auto"; required_version: String, env!("CARGO_PKG_VERSION").to_owned(), false, diff --git a/src/filemap.rs b/src/filemap.rs index 81f950cfb9b5..7b3034dda1e1 100644 --- a/src/filemap.rs +++ b/src/filemap.rs @@ -16,7 +16,7 @@ use std::path::Path; use checkstyle::{output_checkstyle_file, output_footer, output_header}; use config::{Config, NewlineStyle, WriteMode}; -use rustfmt_diff::{make_diff, print_diff, Mismatch}; +use rustfmt_diff::{make_diff, output_modified, print_diff, Mismatch}; use syntax::codemap::FileName; // A map of the files of a crate, with their new content @@ -167,6 +167,15 @@ where return Ok(has_diff); } } + WriteMode::Modified => { + let filename = filename_to_path(); + if let Ok((ori, fmt)) = source_and_formatted_text(text, filename, config) { + let mismatch = make_diff(&ori, &fmt, 0); + let has_diff = !mismatch.is_empty(); + output_modified(out, mismatch); + return Ok(has_diff); + } + } WriteMode::Checkstyle => { let filename = filename_to_path(); let diff = create_diff(filename, text, config)?; diff --git a/src/lib.rs b/src/lib.rs index e24a6c1949cf..8adaa77ef683 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,7 +29,7 @@ extern crate unicode_segmentation; use std::collections::HashMap; use std::fmt; -use std::io::{self, stdout, Write}; +use std::io::{self, stdout, BufRead, Write}; use std::iter::repeat; use std::path::PathBuf; use std::rc::Rc; @@ -693,6 +693,67 @@ pub fn format_input( } } +/// A single span of changed lines, with 0 or more removed lines +/// and a vector of 0 or more inserted lines. +#[derive(Debug, PartialEq, Eq)] +pub struct ModifiedChunk { + /// The first affected line before formatting. + pub line_number: u32, + /// The number of lines which have been replaced + pub lines_removed: u32, + /// The new lines + pub lines: Vec, +} + +/// Set of changed sections of a file. +#[derive(Debug, PartialEq, Eq)] +pub struct ModifiedLines { + /// The set of changed chunks. + pub chunks: Vec, +} + +/// Format a file and return a `ModifiedLines` data structure describing +/// the changed ranges of lines. +pub fn get_modified_lines( + input: Input, + config: &Config, +) -> Result<(Summary, FileMap, FormatReport, ModifiedLines), (io::Error, Summary)> { + let mut data = Vec::new(); + + let mut config = config.clone(); + config.set().write_mode(config::WriteMode::Modified); + let (summary, filemap, formatreport) = format_input(input, &config, Some(&mut data))?; + + let mut lines = data.lines(); + let mut chunks = Vec::new(); + while let Some(Ok(header)) = lines.next() { + // Parse the header line + let values: Vec<_> = header + .split(' ') + .map(|s| s.parse::().unwrap()) + .collect(); + assert_eq!(values.len(), 3); + let line_number = values[0]; + let num_removed = values[1]; + let num_added = values[2]; + let mut added_lines = Vec::new(); + for _ in 0..num_added { + added_lines.push(lines.next().unwrap().unwrap()); + } + chunks.push(ModifiedChunk { + line_number: line_number, + lines_removed: num_removed, + lines: added_lines, + }); + } + Ok(( + summary, + filemap, + formatreport, + ModifiedLines { chunks: chunks }, + )) +} + #[derive(Debug)] pub enum Input { File(PathBuf), diff --git a/src/rustfmt_diff.rs b/src/rustfmt_diff.rs index d563e6eee3c1..a4d6a9bd6a6d 100644 --- a/src/rustfmt_diff.rs +++ b/src/rustfmt_diff.rs @@ -13,6 +13,7 @@ use diff; use std::collections::VecDeque; use std::io; use term; +use std::io::Write; use utils::use_colored_tty; #[derive(Debug, PartialEq)] @@ -24,14 +25,19 @@ pub enum DiffLine { #[derive(Debug, PartialEq)] pub struct Mismatch { + /// The line number in the formatted version. pub line_number: u32, + /// The line number in the original version. + pub line_number_orig: u32, + /// The set of lines (context and old/new) in the mismatch. pub lines: Vec, } impl Mismatch { - fn new(line_number: u32) -> Mismatch { + fn new(line_number: u32, line_number_orig: u32) -> Mismatch { Mismatch { line_number: line_number, + line_number_orig: line_number_orig, lines: Vec::new(), } } @@ -77,17 +83,21 @@ impl OutputWriter { // Produces a diff between the expected output and actual output of rustfmt. pub fn make_diff(expected: &str, actual: &str, context_size: usize) -> Vec { let mut line_number = 1; + let mut line_number_orig = 1; let mut context_queue: VecDeque<&str> = VecDeque::with_capacity(context_size); let mut lines_since_mismatch = context_size + 1; let mut results = Vec::new(); - let mut mismatch = Mismatch::new(0); + let mut mismatch = Mismatch::new(0, 0); for result in diff::lines(expected, actual) { match result { diff::Result::Left(str) => { if lines_since_mismatch >= context_size && lines_since_mismatch > 0 { results.push(mismatch); - mismatch = Mismatch::new(line_number - context_queue.len() as u32); + mismatch = Mismatch::new( + line_number - context_queue.len() as u32, + line_number_orig - context_queue.len() as u32, + ); } while let Some(line) = context_queue.pop_front() { @@ -95,12 +105,16 @@ pub fn make_diff(expected: &str, actual: &str, context_size: usize) -> Vec { if lines_since_mismatch >= context_size && lines_since_mismatch > 0 { results.push(mismatch); - mismatch = Mismatch::new(line_number - context_queue.len() as u32); + mismatch = Mismatch::new( + line_number - context_queue.len() as u32, + line_number_orig - context_queue.len() as u32, + ); } while let Some(line) = context_queue.pop_front() { @@ -123,6 +137,7 @@ pub fn make_diff(expected: &str, actual: &str, context_size: usize) -> Vec(mut out: W, diff: Vec) +where + W: Write, +{ + for mismatch in diff { + let (num_removed, num_added) = mismatch.lines.iter().fold((0, 0), |(rem, add), line| { + match *line { + DiffLine::Context(_) => panic!("No Context expected"), + DiffLine::Expected(_) => (rem, add + 1), + DiffLine::Resulting(_) => (rem + 1, add), + } + }); + // Write a header with enough information to separate the modified lines. + writeln!( + out, + "{} {} {}", + mismatch.line_number_orig, num_removed, num_added + ).unwrap(); + + for line in mismatch.lines { + match line { + DiffLine::Context(_) | DiffLine::Resulting(_) => (), + DiffLine::Expected(ref str) => { + writeln!(out, "{}", str).unwrap(); + } + } + } + } +} + #[cfg(test)] mod test { use super::{make_diff, Mismatch}; @@ -173,6 +224,7 @@ mod test { vec![ Mismatch { line_number: 2, + line_number_orig: 2, lines: vec![ Context("two".to_owned()), Resulting("three".to_owned()), @@ -194,6 +246,7 @@ mod test { vec![ Mismatch { line_number: 2, + line_number_orig: 2, lines: vec![ Context("two".to_owned()), Resulting("three".to_owned()), @@ -203,6 +256,7 @@ mod test { }, Mismatch { line_number: 5, + line_number_orig: 5, lines: vec![ Resulting("five".to_owned()), Expected("cinq".to_owned()), @@ -223,6 +277,7 @@ mod test { vec![ Mismatch { line_number: 3, + line_number_orig: 3, lines: vec![Resulting("three".to_owned()), Expected("trois".to_owned())], }, ] @@ -239,6 +294,7 @@ mod test { vec![ Mismatch { line_number: 5, + line_number_orig: 5, lines: vec![Context("five".to_owned()), Expected("".to_owned())], }, ] diff --git a/tests/system.rs b/tests/system.rs index 8125e7fd2b6c..bdd36cec736b 100644 --- a/tests/system.rs +++ b/tests/system.rs @@ -143,6 +143,31 @@ fn checkstyle_test() { assert_output(Path::new(filename), Path::new(expected_filename)); } +#[test] +fn modified_test() { + // Test "modified" output + let filename = "tests/writemode/source/modified.rs"; + let (_summary, _filemap, _report, modified) = + get_modified_lines(Input::File(filename.into()), &Config::default()).unwrap(); + assert_eq!( + modified, + ModifiedLines { + chunks: vec![ + ModifiedChunk { + line_number: 4, + lines_removed: 4, + lines: vec!["fn blah() {}".into()], + }, + ModifiedChunk { + line_number: 9, + lines_removed: 6, + lines: vec!["#[cfg(a, b)]".into(), "fn main() {}".into()], + }, + ], + } + ); +} + // Helper function for comparing the results of rustfmt // to a known output file generated by one of the write modes. fn assert_output(source: &Path, expected_filename: &Path) { @@ -503,6 +528,7 @@ fn rustfmt_diff_make_diff_tests() { vec![ Mismatch { line_number: 1, + line_number_orig: 1, lines: vec![ DiffLine::Context("a".into()), DiffLine::Resulting("b".into()), diff --git a/tests/writemode/source/modified.rs b/tests/writemode/source/modified.rs new file mode 100644 index 000000000000..948beb348dbb --- /dev/null +++ b/tests/writemode/source/modified.rs @@ -0,0 +1,14 @@ +// rustfmt-write_mode: modified +// Test "modified" output + +fn +blah +() +{ } + + +#[cfg +( a , b +)] +fn +main() {} diff --git a/tests/writemode/target/modified.txt b/tests/writemode/target/modified.txt new file mode 100644 index 000000000000..5c0539a665e6 --- /dev/null +++ b/tests/writemode/target/modified.txt @@ -0,0 +1,5 @@ +4 4 1 +fn blah() {} +10 5 2 +#[cfg(a, b)] +fn main() {} From 7213b88ba198ceabdf91acb1a24e6a3d4dc5002f Mon Sep 17 00:00:00 2001 From: Chris Emerson Date: Sat, 20 Jan 2018 20:45:06 +0000 Subject: [PATCH 2/6] Return a struct instead of a 4-tuple from get_modified_lines(). --- src/lib.rs | 26 +++++++++++++++++++------- tests/system.rs | 5 ++--- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8adaa77ef683..fdec104ab930 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -712,12 +712,24 @@ pub struct ModifiedLines { pub chunks: Vec, } +/// The successful result of formatting via get_modified_lines(). +pub struct ModifiedLinesResult { + /// The high level summary details + pub summary: Summary, + /// The result Filemap + pub filemap: FileMap, + /// Map of formatting errors + pub report: FormatReport, + /// The sets of updated lines. + pub modified_lines: ModifiedLines, +} + /// Format a file and return a `ModifiedLines` data structure describing /// the changed ranges of lines. pub fn get_modified_lines( input: Input, config: &Config, -) -> Result<(Summary, FileMap, FormatReport, ModifiedLines), (io::Error, Summary)> { +) -> Result { let mut data = Vec::new(); let mut config = config.clone(); @@ -746,12 +758,12 @@ pub fn get_modified_lines( lines: added_lines, }); } - Ok(( - summary, - filemap, - formatreport, - ModifiedLines { chunks: chunks }, - )) + Ok(ModifiedLinesResult { + summary: summary, + filemap: filemap, + report: formatreport, + modified_lines: ModifiedLines { chunks: chunks }, + }) } #[derive(Debug)] diff --git a/tests/system.rs b/tests/system.rs index bdd36cec736b..432d58e5fe15 100644 --- a/tests/system.rs +++ b/tests/system.rs @@ -147,10 +147,9 @@ fn checkstyle_test() { fn modified_test() { // Test "modified" output let filename = "tests/writemode/source/modified.rs"; - let (_summary, _filemap, _report, modified) = - get_modified_lines(Input::File(filename.into()), &Config::default()).unwrap(); + let result = get_modified_lines(Input::File(filename.into()), &Config::default()).unwrap(); assert_eq!( - modified, + result.modified_lines, ModifiedLines { chunks: vec![ ModifiedChunk { From 6f669091e0895851a92972d634f8afa44c372589 Mon Sep 17 00:00:00 2001 From: Chris Emerson Date: Sat, 20 Jan 2018 20:46:30 +0000 Subject: [PATCH 3/6] Fix typo in comment. --- src/rustfmt_diff.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rustfmt_diff.rs b/src/rustfmt_diff.rs index a4d6a9bd6a6d..9053d0f72863 100644 --- a/src/rustfmt_diff.rs +++ b/src/rustfmt_diff.rs @@ -177,7 +177,7 @@ where /// enough information to modify the original file. /// Each section starts with a line with three integers, space separated: /// lineno num_removed num_added -/// followd by (num_added) lines of added text. The line numbers are +/// followed by (num_added) lines of added text. The line numbers are /// relative to the original file. pub fn output_modified(mut out: W, diff: Vec) where From e02f2685776e7fa8f0cee4b2c81d28a85288cb30 Mon Sep 17 00:00:00 2001 From: Chris Emerson Date: Mon, 12 Feb 2018 22:58:50 +0000 Subject: [PATCH 4/6] Move the modified test files to the new location. --- {tests => rustfmt-core/tests}/writemode/source/modified.rs | 0 {tests => rustfmt-core/tests}/writemode/target/modified.txt | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {tests => rustfmt-core/tests}/writemode/source/modified.rs (100%) rename {tests => rustfmt-core/tests}/writemode/target/modified.txt (100%) diff --git a/tests/writemode/source/modified.rs b/rustfmt-core/tests/writemode/source/modified.rs similarity index 100% rename from tests/writemode/source/modified.rs rename to rustfmt-core/tests/writemode/source/modified.rs diff --git a/tests/writemode/target/modified.txt b/rustfmt-core/tests/writemode/target/modified.txt similarity index 100% rename from tests/writemode/target/modified.txt rename to rustfmt-core/tests/writemode/target/modified.txt From 807f29206af573d4a1ac3c870f0ebaf87f73e4c8 Mon Sep 17 00:00:00 2001 From: Chris Emerson Date: Mon, 12 Feb 2018 23:07:46 +0000 Subject: [PATCH 5/6] Update after review comments. --- Configurations.md | 2 +- rustfmt-core/src/lib.rs | 14 +++++++------- rustfmt-core/tests/lib.rs | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Configurations.md b/Configurations.md index b908120d051d..4390d49d1254 100644 --- a/Configurations.md +++ b/Configurations.md @@ -1915,7 +1915,7 @@ See also: [`match_block_trailing_comma`](#match_block_trailing_comma). What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage - **Default value**: `"Overwrite"` -- **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`, `"Modified"` +- **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"` - **Stable**: No ## `blank_lines_upper_bound` diff --git a/rustfmt-core/src/lib.rs b/rustfmt-core/src/lib.rs index e53db8a4b464..d94f2a2c12c4 100644 --- a/rustfmt-core/src/lib.rs +++ b/rustfmt-core/src/lib.rs @@ -708,8 +708,8 @@ pub fn format_input( /// and a vector of 0 or more inserted lines. #[derive(Debug, PartialEq, Eq)] pub struct ModifiedChunk { - /// The first affected line before formatting. - pub line_number: u32, + /// The first to be removed from the original text + pub line_number_orig: u32, /// The number of lines which have been replaced pub lines_removed: u32, /// The new lines @@ -756,16 +756,16 @@ pub fn get_modified_lines( .map(|s| s.parse::().unwrap()) .collect(); assert_eq!(values.len(), 3); - let line_number = values[0]; - let num_removed = values[1]; + let line_number_orig = values[0]; + let lines_removed = values[1]; let num_added = values[2]; let mut added_lines = Vec::new(); for _ in 0..num_added { added_lines.push(lines.next().unwrap().unwrap()); } chunks.push(ModifiedChunk { - line_number: line_number, - lines_removed: num_removed, + line_number_orig, + lines_removed, lines: added_lines, }); } @@ -773,7 +773,7 @@ pub fn get_modified_lines( summary: summary, filemap: filemap, report: formatreport, - modified_lines: ModifiedLines { chunks: chunks }, + modified_lines: ModifiedLines { chunks }, }) } diff --git a/rustfmt-core/tests/lib.rs b/rustfmt-core/tests/lib.rs index 6a310d175b19..3a990ebe88c5 100644 --- a/rustfmt-core/tests/lib.rs +++ b/rustfmt-core/tests/lib.rs @@ -153,12 +153,12 @@ fn modified_test() { ModifiedLines { chunks: vec![ ModifiedChunk { - line_number: 4, + line_number_orig: 4, lines_removed: 4, lines: vec!["fn blah() {}".into()], }, ModifiedChunk { - line_number: 9, + line_number_orig: 9, lines_removed: 6, lines: vec!["#[cfg(a, b)]".into(), "fn main() {}".into()], }, From 2a3caa7f577c0ff3e98106049df4662401c41a73 Mon Sep 17 00:00:00 2001 From: Chris Emerson Date: Mon, 12 Feb 2018 23:09:07 +0000 Subject: [PATCH 6/6] Update comment to say that Modified is for internal use only. --- rustfmt-config/src/options.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rustfmt-config/src/options.rs b/rustfmt-config/src/options.rs index b6a28b9b58c4..885d89ed752d 100644 --- a/rustfmt-config/src/options.rs +++ b/rustfmt-config/src/options.rs @@ -176,7 +176,7 @@ configuration_option_enum! { WriteMode: Plain, // Outputs a checkstyle XML file. Checkstyle, - // Output the changed lines + // Output the changed lines (for internal value only) Modified, }