mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 23:25:14 +00:00
Add a CLI flag to force-ignore noqa directives (#3296)
This commit is contained in:
parent
4a70a4c323
commit
3ed539d50e
10 changed files with 55 additions and 15 deletions
|
@ -93,6 +93,9 @@ pub struct CheckArgs {
|
|||
fix_only: bool,
|
||||
#[clap(long, overrides_with("fix_only"), hide = true)]
|
||||
no_fix_only: bool,
|
||||
/// Ignore any `# noqa` comments.
|
||||
#[arg(long)]
|
||||
ignore_noqa: bool,
|
||||
/// Output serialization format for violations.
|
||||
#[arg(long, value_enum, env = "RUFF_FORMAT")]
|
||||
pub format: Option<SerializationFormat>,
|
||||
|
@ -258,6 +261,7 @@ pub struct CheckArgs {
|
|||
conflicts_with = "show_files",
|
||||
conflicts_with = "show_settings",
|
||||
// Unsupported default-command arguments.
|
||||
conflicts_with = "ignore_noqa",
|
||||
conflicts_with = "statistics",
|
||||
conflicts_with = "stdin_filename",
|
||||
conflicts_with = "watch",
|
||||
|
@ -272,6 +276,7 @@ pub struct CheckArgs {
|
|||
// conflicts_with = "show_files",
|
||||
conflicts_with = "show_settings",
|
||||
// Unsupported default-command arguments.
|
||||
conflicts_with = "ignore_noqa",
|
||||
conflicts_with = "statistics",
|
||||
conflicts_with = "stdin_filename",
|
||||
conflicts_with = "watch",
|
||||
|
@ -285,6 +290,7 @@ pub struct CheckArgs {
|
|||
conflicts_with = "show_files",
|
||||
// conflicts_with = "show_settings",
|
||||
// Unsupported default-command arguments.
|
||||
conflicts_with = "ignore_noqa",
|
||||
conflicts_with = "statistics",
|
||||
conflicts_with = "stdin_filename",
|
||||
conflicts_with = "watch",
|
||||
|
@ -357,6 +363,7 @@ impl CheckArgs {
|
|||
exit_zero: self.exit_zero,
|
||||
exit_non_zero_on_fix: self.exit_non_zero_on_fix,
|
||||
files: self.files,
|
||||
ignore_noqa: self.ignore_noqa,
|
||||
isolated: self.isolated,
|
||||
no_cache: self.no_cache,
|
||||
show_files: self.show_files,
|
||||
|
@ -415,6 +422,7 @@ pub struct Arguments {
|
|||
pub exit_zero: bool,
|
||||
pub exit_non_zero_on_fix: bool,
|
||||
pub files: Vec<PathBuf>,
|
||||
pub ignore_noqa: bool,
|
||||
pub isolated: bool,
|
||||
pub no_cache: bool,
|
||||
pub show_files: bool,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue