Introduce tab-size to correcly calculate the line length with tabulations (#4167)

This commit is contained in:
Jonathan Plasse 2023-05-24 08:37:24 +02:00 committed by GitHub
parent 3644695bf2
commit c6a760e298
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 1005 additions and 173 deletions

View file

@ -5,6 +5,7 @@ use clap::{command, Parser};
use regex::Regex;
use rustc_hash::FxHashMap;
use ruff::line_width::LineLength;
use ruff::logging::LogLevel;
use ruff::registry::Rule;
use ruff::resolver::ConfigProcessor;
@ -545,7 +546,7 @@ impl ConfigProcessor for &Overrides {
config.force_exclude = Some(*force_exclude);
}
if let Some(line_length) = &self.line_length {
config.line_length = Some(*line_length);
config.line_length = Some(LineLength::from(*line_length));
}
if let Some(per_file_ignores) = &self.per_file_ignores {
config.per_file_ignores = Some(collect_per_file_ignores(per_file_ignores.clone()));