Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/ruff/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,12 @@ pub struct CheckCommand {
conflicts_with = "watch",
)]
pub statistics: bool,
/// Enable automatic additions of `noqa` directives to failing lines.
/// Enable automatic additions of suppression directives to failing lines.
/// Uses `ruff:ignore` in preview mode and `noqa` otherwise.
/// Optionally provide a reason to append after the codes.
#[arg(
long,
visible_alias = "add-ignore",
value_name = "REASON",
default_missing_value = "",
num_args = 0..=1,
Expand Down
6 changes: 3 additions & 3 deletions crates/ruff/src/commands/add_noqa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use ruff_workspace::resolver::{

use crate::args::ConfigArguments;

/// Add `noqa` directives to a collection of files.
/// Add suppression directives to a collection of files.
pub(crate) fn add_noqa(
files: &[PathBuf],
pyproject_config: &PyprojectConfig,
Expand Down Expand Up @@ -95,15 +95,15 @@ pub(crate) fn add_noqa(
) {
Ok(count) => Some(count),
Err(e) => {
error!("Failed to add noqa to {}: {e}", path.display());
error!("Failed to add suppression to {}: {e}", path.display());
None
}
}
})
.sum();

let duration = start.elapsed();
debug!("Added noqa to files in: {duration:?}");
debug!("Added suppressions to files in: {duration:?}");

Ok(modifications)
}
2 changes: 1 addition & 1 deletion crates/ruff/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ pub fn check(args: CheckCommand, global_options: GlobalConfigArgs) -> Result<Exi
let s = if modifications == 1 { "" } else { "s" };
#[expect(clippy::print_stderr)]
{
eprintln!("Added {modifications} noqa directive{s}.");
eprintln!("Added {modifications} suppression comment{s}.");
}
}
return Ok(ExitStatus::Success);
Expand Down
Loading
Loading