Skip to content

Commit a9d884d

Browse files
committed
tidy: py:lint extra check now works with --bless
1 parent 469a80e commit a9d884d

File tree

1 file changed

+9
-2
lines changed
  • src/tools/tidy/src/extra_checks

1 file changed

+9
-2
lines changed

src/tools/tidy/src/extra_checks/mod.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,16 @@ fn check_impl(
147147
}
148148

149149
if python_lint {
150-
eprintln!("linting python files");
151150
let py_path = py_path.as_ref().unwrap();
152-
let res = run_ruff(root_path, outdir, py_path, &cfg_args, &file_args, &["check".as_ref()]);
151+
let args: &[&OsStr] = if bless {
152+
eprintln!("linting python files and applying suggestions");
153+
&["check".as_ref(), "--fix".as_ref()]
154+
} else {
155+
eprintln!("linting python files");
156+
&["check".as_ref()]
157+
};
158+
159+
let res = run_ruff(root_path, outdir, py_path, &cfg_args, &file_args, args);
153160

154161
if res.is_err() && show_diff {
155162
eprintln!("\npython linting failed! Printing diff suggestions:");

0 commit comments

Comments
 (0)