Re-show --target-version on CLI interface (#2859)

This commit is contained in:
Charlie Marsh 2023-02-13 10:04:11 -05:00 committed by GitHub
parent 1705574e75
commit 6128346b08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 16 deletions

View File

@ -437,19 +437,34 @@ Arguments:
[FILES]... List of files or directories to check [FILES]... List of files or directories to check
Options: Options:
--fix Attempt to automatically fix lint violations --fix
--show-source Show violations with source code Attempt to automatically fix lint violations
--show-fixes Show an enumeration of all autofixed lint violations --show-source
--diff Avoid writing any fixed files back; instead, output a diff for each changed file to stdout Show violations with source code
-w, --watch Run in watch mode by re-running whenever files change --show-fixes
--fix-only Fix any fixable lint violations, but don't report on leftover violations. Implies `--fix` Show an enumeration of all autofixed lint violations
--format <FORMAT> Output serialization format for violations [env: RUFF_FORMAT=] [possible values: text, json, junit, grouped, github, gitlab, pylint] --diff
--config <CONFIG> Path to the `pyproject.toml` or `ruff.toml` file to use for configuration Avoid writing any fixed files back; instead, output a diff for each changed file to stdout
--statistics Show counts for every rule with at least one violation -w, --watch
--add-noqa Enable automatic additions of `noqa` directives to failing lines Run in watch mode by re-running whenever files change
--show-files See the files Ruff will be run against with the current settings --fix-only
--show-settings See the settings Ruff will use to lint a given Python file Fix any fixable lint violations, but don't report on leftover violations. Implies `--fix`
-h, --help Print help --format <FORMAT>
Output serialization format for violations [env: RUFF_FORMAT=] [possible values: text, json, junit, grouped, github, gitlab, pylint]
--target-version <TARGET_VERSION>
The minimum Python version that should be supported
--config <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: Rule selection:
--select <RULE_CODE> --select <RULE_CODE>

View File

@ -96,6 +96,9 @@ pub struct CheckArgs {
/// Output serialization format for violations. /// Output serialization format for violations.
#[arg(long, value_enum, env = "RUFF_FORMAT")] #[arg(long, value_enum, env = "RUFF_FORMAT")]
pub format: Option<SerializationFormat>, pub format: Option<SerializationFormat>,
/// The minimum Python version that should be supported.
#[arg(long)]
pub target_version: Option<PythonVersion>,
/// Path to the `pyproject.toml` or `ruff.toml` file to use for /// Path to the `pyproject.toml` or `ruff.toml` file to use for
/// configuration. /// configuration.
#[arg(long, conflicts_with = "isolated")] #[arg(long, conflicts_with = "isolated")]
@ -193,9 +196,6 @@ pub struct CheckArgs {
force_exclude: bool, force_exclude: bool,
#[clap(long, overrides_with("force_exclude"), hide = true)] #[clap(long, overrides_with("force_exclude"), hide = true)]
no_force_exclude: bool, no_force_exclude: bool,
/// The minimum Python version that should be supported.
#[arg(long, help_heading = "Rule configuration", hide = true)]
pub target_version: Option<PythonVersion>,
/// Set the line-length for length-associated rules and automatic /// Set the line-length for length-associated rules and automatic
/// formatting. /// formatting.
#[arg(long, help_heading = "Rule configuration", hide = true)] #[arg(long, help_heading = "Rule configuration", hide = true)]