mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:43 +00:00
Add --line-length command line argument (#759)
This commit is contained in:
parent
ff0e5f5cb4
commit
0d3fac1bf9
3 changed files with 9 additions and 0 deletions
|
@ -237,6 +237,8 @@ Options:
|
||||||
Regular expression matching the name of dummy variables
|
Regular expression matching the name of dummy variables
|
||||||
--target-version <TARGET_VERSION>
|
--target-version <TARGET_VERSION>
|
||||||
The minimum Python version that should be supported
|
The minimum Python version that should be supported
|
||||||
|
--line-length <LINE_LENGTH>
|
||||||
|
Set the line-length for length-associated checks and automatic formatting
|
||||||
--stdin-filename <STDIN_FILENAME>
|
--stdin-filename <STDIN_FILENAME>
|
||||||
The name of the file when passing it through stdin
|
The name of the file when passing it through stdin
|
||||||
-h, --help
|
-h, --help
|
||||||
|
|
|
@ -87,6 +87,10 @@ pub struct Cli {
|
||||||
/// The minimum Python version that should be supported.
|
/// The minimum Python version that should be supported.
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub target_version: Option<PythonVersion>,
|
pub target_version: Option<PythonVersion>,
|
||||||
|
/// Set the line-length for length-associated checks and automatic
|
||||||
|
/// formatting.
|
||||||
|
#[arg(long)]
|
||||||
|
pub line_length: Option<usize>,
|
||||||
/// Round-trip auto-formatting.
|
/// Round-trip auto-formatting.
|
||||||
// TODO(charlie): This should be a sub-command.
|
// TODO(charlie): This should be a sub-command.
|
||||||
#[arg(long, hide = true)]
|
#[arg(long, hide = true)]
|
||||||
|
|
|
@ -292,6 +292,9 @@ fn inner_main() -> Result<ExitCode> {
|
||||||
if !cli.extend_ignore.is_empty() {
|
if !cli.extend_ignore.is_empty() {
|
||||||
configuration.extend_ignore = cli.extend_ignore;
|
configuration.extend_ignore = cli.extend_ignore;
|
||||||
}
|
}
|
||||||
|
if let Some(line_length) = cli.line_length {
|
||||||
|
configuration.line_length = line_length;
|
||||||
|
}
|
||||||
if let Some(target_version) = cli.target_version {
|
if let Some(target_version) = cli.target_version {
|
||||||
configuration.target_version = target_version;
|
configuration.target_version = target_version;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue