diff --git a/crates/ruff/src/rules/pycodestyle/rules/tab_indentation.rs b/crates/ruff/src/rules/pycodestyle/rules/tab_indentation.rs index f09219c9921fac..a2d67779fcc020 100644 --- a/crates/ruff/src/rules/pycodestyle/rules/tab_indentation.rs +++ b/crates/ruff/src/rules/pycodestyle/rules/tab_indentation.rs @@ -5,6 +5,26 @@ use ruff_macros::{derive_message_formats, violation}; use ruff_python_ast::source_code::Indexer; use ruff_python_trivia::{leading_indentation, Line}; +/// ## What it does +/// Checks for indentation that uses tabs. +/// +/// ## Why is this bad? +/// According to [PEP 8], spaces are preferred over tabs (unless used to remain +/// consistent with code that is already indented with tabs). +/// +/// ## Example +/// ```python +/// if True: +/// \ta = 1 +/// ``` +/// +/// Use instead: +/// ```python +/// if True: +/// a = 1 +/// ``` +/// +/// [PEP 8]: https://peps.python.org/pep-0008/#tabs-or-spaces #[violation] pub struct TabIndentation;