diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/indentation.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/indentation.rs index ccad943475..94bb672e9c 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/indentation.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/indentation.rs @@ -31,18 +31,21 @@ use super::LogicalLine; /// The rule is also incompatible with the [formatter] when using /// `indent-width` with a value other than `4`. /// +/// ## Options +/// - `indent-width` +/// /// [PEP 8]: https://peps.python.org/pep-0008/#indentation /// [formatter]:https://docs.astral.sh/ruff/formatter/ #[violation] pub struct IndentationWithInvalidMultiple { - indent_size: usize, + indent_width: usize, } impl Violation for IndentationWithInvalidMultiple { #[derive_message_formats] fn message(&self) -> String { - let Self { indent_size } = self; - format!("Indentation is not a multiple of {indent_size}") + let Self { indent_width } = self; + format!("Indentation is not a multiple of {indent_width}") } } @@ -71,18 +74,21 @@ impl Violation for IndentationWithInvalidMultiple { /// The rule is also incompatible with the [formatter] when using /// `indent-width` with a value other than `4`. /// +/// ## Options +/// - `indent-width` +/// /// [PEP 8]: https://peps.python.org/pep-0008/#indentation /// [formatter]:https://docs.astral.sh/ruff/formatter/ #[violation] pub struct IndentationWithInvalidMultipleComment { - indent_size: usize, + indent_width: usize, } impl Violation for IndentationWithInvalidMultipleComment { #[derive_message_formats] fn message(&self) -> String { - let Self { indent_size } = self; - format!("Indentation is not a multiple of {indent_size} (comment)") + let Self { indent_width } = self; + format!("Indentation is not a multiple of {indent_width} (comment)") } } @@ -257,9 +263,13 @@ pub(crate) fn indentation( if indent_level % indent_size != 0 { diagnostics.push(if logical_line.is_comment_only() { - DiagnosticKind::from(IndentationWithInvalidMultipleComment { indent_size }) + DiagnosticKind::from(IndentationWithInvalidMultipleComment { + indent_width: indent_size, + }) } else { - DiagnosticKind::from(IndentationWithInvalidMultiple { indent_size }) + DiagnosticKind::from(IndentationWithInvalidMultiple { + indent_width: indent_size, + }) }); } let indent_expect = prev_logical_line