Report number of changed files on the format CLI (#6948)

## Summary

Very basic summary:

<img width="962" alt="Screen Shot 2023-08-28 at 1 17 37 PM"
src="53537aca-7579-44d8-855b-f4553affae50">

If you run with `--verbose`, we'll also show you the timing:

<img width="962" alt="Screen Shot 2023-08-28 at 1 17 58 PM"
src="63cbd13e-9462-4e49-b3a3-c6663a7ad41c">
This commit is contained in:
Charlie Marsh 2023-08-28 18:42:31 -04:00 committed by GitHub
parent fc47e0dab2
commit 1439bb592e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 133 additions and 25 deletions

View file

@ -148,13 +148,13 @@ quoting the executed command, along with the relevant file contents and `pyproje
shell.generate(&mut Args::command(), &mut stdout());
}
Command::Check(args) => return check(args, log_level),
Command::Format(args) => return format(args),
Command::Format(args) => return format(args, log_level),
}
Ok(ExitStatus::Success)
}
fn format(args: FormatCommand) -> Result<ExitStatus> {
fn format(args: FormatCommand, log_level: LogLevel) -> Result<ExitStatus> {
warn_user_once!(
"`ruff format` is a work-in-progress, subject to change at any time, and intended only for \
experimentation."
@ -173,7 +173,7 @@ fn format(args: FormatCommand) -> Result<ExitStatus> {
stdout().lock().write_all(formatted.as_code().as_bytes())?;
Ok(ExitStatus::Success)
} else {
commands::format::format(&cli, &overrides)
commands::format::format(&cli, &overrides, log_level)
}
}