Rename tab-size to indent-width (#8082)

## Summary

This PR renames the `tab-size` configuration option to `indent-width` to
express that the formatter uses the option to determine the indentation
width AND as tab width.

I first preferred naming the option `tab-width` but then decided to go
with `indent-width` because:

* It aligns with the `indent-style` option
* It would allow us to write a lint rule that asserts that each
indentation uses `indent-width` spaces.

 Closes #7643

## Test Plan

Added integration test
This commit is contained in:
Micha Reiser 2023-10-24 23:01:24 +09:00 committed by GitHub
parent c3dabc1933
commit 84979f9673
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 143 additions and 49 deletions

View file

@ -6,7 +6,7 @@ use wasm_bindgen::prelude::*;
use ruff_formatter::{FormatResult, Formatted, IndentStyle};
use ruff_linter::directives;
use ruff_linter::line_width::{LineLength, TabSize};
use ruff_linter::line_width::{IndentWidth, LineLength};
use ruff_linter::linter::{check_path, LinterResult};
use ruff_linter::registry::AsRule;
use ruff_linter::settings::types::PythonVersion;
@ -126,7 +126,7 @@ impl Workspace {
line_length: Some(LineLength::default()),
tab_size: Some(TabSize::default()),
indent_width: Some(IndentWidth::default()),
target_version: Some(PythonVersion::default()),
lint: Some(LintOptions {