From 6128346b0899c222ef287c00e95622dda14c0dfd Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 13 Feb 2023 10:04:11 -0500 Subject: [PATCH] Re-show --target-version on CLI interface (#2859) --- README.md | 41 +++++++++++++++++++++++++------------ crates/ruff_cli/src/args.rs | 6 +++--- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 29c5907873..ee22dfa702 100644 --- a/README.md +++ b/README.md @@ -437,19 +437,34 @@ Arguments: [FILES]... List of files or directories to check Options: - --fix Attempt to automatically fix lint violations - --show-source Show violations with source code - --show-fixes Show an enumeration of all autofixed lint violations - --diff Avoid writing any fixed files back; instead, output a diff for each changed file to stdout - -w, --watch Run in watch mode by re-running whenever files change - --fix-only Fix any fixable lint violations, but don't report on leftover violations. Implies `--fix` - --format Output serialization format for violations [env: RUFF_FORMAT=] [possible values: text, json, junit, grouped, github, gitlab, pylint] - --config Path to the `pyproject.toml` or `ruff.toml` file to use for configuration - --statistics Show counts for every rule with at least one violation - --add-noqa Enable automatic additions of `noqa` directives to failing lines - --show-files See the files Ruff will be run against with the current settings - --show-settings See the settings Ruff will use to lint a given Python file - -h, --help Print help + --fix + Attempt to automatically fix lint violations + --show-source + Show violations with source code + --show-fixes + Show an enumeration of all autofixed lint violations + --diff + Avoid writing any fixed files back; instead, output a diff for each changed file to stdout + -w, --watch + Run in watch mode by re-running whenever files change + --fix-only + Fix any fixable lint violations, but don't report on leftover violations. Implies `--fix` + --format + Output serialization format for violations [env: RUFF_FORMAT=] [possible values: text, json, junit, grouped, github, gitlab, pylint] + --target-version + The minimum Python version that should be supported + --config + Path to the `pyproject.toml` or `ruff.toml` file to use for configuration + --statistics + Show counts for every rule with at least one violation + --add-noqa + Enable automatic additions of `noqa` directives to failing lines + --show-files + See the files Ruff will be run against with the current settings + --show-settings + See the settings Ruff will use to lint a given Python file + -h, --help + Print help Rule selection: --select diff --git a/crates/ruff_cli/src/args.rs b/crates/ruff_cli/src/args.rs index fd4cfb5f8b..5980c7e6c6 100644 --- a/crates/ruff_cli/src/args.rs +++ b/crates/ruff_cli/src/args.rs @@ -96,6 +96,9 @@ pub struct CheckArgs { /// Output serialization format for violations. #[arg(long, value_enum, env = "RUFF_FORMAT")] pub format: Option, + /// The minimum Python version that should be supported. + #[arg(long)] + pub target_version: Option, /// Path to the `pyproject.toml` or `ruff.toml` file to use for /// configuration. #[arg(long, conflicts_with = "isolated")] @@ -193,9 +196,6 @@ pub struct CheckArgs { force_exclude: bool, #[clap(long, overrides_with("force_exclude"), hide = true)] no_force_exclude: bool, - /// The minimum Python version that should be supported. - #[arg(long, help_heading = "Rule configuration", hide = true)] - pub target_version: Option, /// Set the line-length for length-associated rules and automatic /// formatting. #[arg(long, help_heading = "Rule configuration", hide = true)]