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