diff --git a/README.md b/README.md index 3cdd6cbd61..55ca9b50e8 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,8 @@ Options: Regular expression matching the name of dummy variables --target-version The minimum Python version that should be supported + --line-length + Set the line-length for length-associated checks and automatic formatting --stdin-filename The name of the file when passing it through stdin -h, --help diff --git a/src/cli.rs b/src/cli.rs index dd4564d8c8..81a45283da 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -87,6 +87,10 @@ pub struct Cli { /// The minimum Python version that should be supported. #[arg(long)] pub target_version: Option, + /// Set the line-length for length-associated checks and automatic + /// formatting. + #[arg(long)] + pub line_length: Option, /// Round-trip auto-formatting. // TODO(charlie): This should be a sub-command. #[arg(long, hide = true)] diff --git a/src/main.rs b/src/main.rs index 160edb3653..30029b4df8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -292,6 +292,9 @@ fn inner_main() -> Result { if !cli.extend_ignore.is_empty() { 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 { configuration.target_version = target_version; }