Support --fix in watch mode (#4035)

This commit is contained in:
Evan Rittenhouse 2023-04-19 22:33:12 -05:00 committed by GitHub
parent cb762f4cad
commit 6e8d561090
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -179,9 +179,6 @@ fn check(args: CheckArgs, log_level: LogLevel) -> Result<ExitStatus> {
let printer = Printer::new(format, log_level, autofix, printer_flags);
if cli.watch {
if !matches!(autofix, flags::FixMode::None) {
warn_user_once!("--fix is unsupported in watch mode.");
}
if format != SerializationFormat::Text {
warn_user_once!("--format 'text' is used in watch mode.");
}
@ -226,7 +223,7 @@ fn check(args: CheckArgs, log_level: LogLevel) -> Result<ExitStatus> {
&overrides,
cache.into(),
noqa.into(),
flags::FixMode::None,
autofix,
)?;
printer.write_continuously(&messages)?;
}