Skip to content

Commit 55348f6

Browse files
committed
Add note about why format_code_from_path is better for rustfmt
1 parent f1c0a28 commit 55348f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

check_diff/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ fn dynamic_library_path_env_var_name() -> &'static str {
299299
}
300300

301301
impl CodeFormatter for RustfmtRunner {
302+
// When rustfmt knows the file path it's able to skip formatting for files listed in the repo's
303+
// rustfmt.toml `ignore` list. For example, this helps us skip files in r-l/rust that have
304+
// been explicitly skipped because trying to format them causes rustfmt to hang or rustfmt.
305+
// doesn't do a good job at formatting those files.
302306
fn format_code_from_path<T: AsRef<str>, P: AsRef<Path>>(
303307
&self,
304308
path: P,

0 commit comments

Comments
 (0)