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 serde::{Deserialize, Serialize};
use wasm_bindgen::prelude::*;
use ruff::directives;
use ruff::line_width::{LineLength, TabSize};
use ruff::linter::{check_path, LinterResult};
use ruff::registry::AsRule;
use ruff::rules::{
@ -102,7 +103,8 @@ pub fn defaultSettings() -> Result<JsValue, JsValue> {
extend_unfixable: Some(Vec::default()),
external: Some(Vec::default()),
ignore: Some(Vec::default()),
line_length: Some(defaults::LINE_LENGTH),
line_length: Some(LineLength::default()),
tab_size: Some(TabSize::default()),
select: Some(defaults::PREFIXES.to_vec()),
target_version: Some(defaults::TARGET_VERSION),
// Ignore a bunch of options that don't make sense in a single-file editor.