Skip to content

Commit d46c5d8

Browse files
authored
docs: Formatter compatibility warning for D207 and D300 (#10007)
- Update docs to mention formatter compatibility interactions for under-indentation (D207) and triple-single-quotes (D300) - Changes verified locally with mkdocs - Closes: #9675
1 parent 20217e9 commit d46c5d8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

crates/ruff_linter/src/rules/pydocstyle/rules/indent.rs

+5
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,17 @@ impl Violation for IndentWithSpaces {
8787
/// """
8888
/// ```
8989
///
90+
/// ## Formatter compatibility
91+
/// We recommend against using this rule alongside the [formatter]. The
92+
/// formatter enforces consistent indentation, making the rule redundant.
93+
///
9094
/// ## References
9195
/// - [PEP 257 – Docstring Conventions](https://peps.python.org/pep-0257/)
9296
/// - [NumPy Style Guide](https://numpydoc.readthedocs.io/en/latest/format.html)
9397
/// - [Google Python Style Guide - Docstrings](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings)
9498
///
9599
/// [PEP 257]: https://peps.python.org/pep-0257/
100+
/// [formatter]: https://docs.astral.sh/ruff/formatter/
96101
#[violation]
97102
pub struct UnderIndentation;
98103

crates/ruff_linter/src/rules/pydocstyle/rules/triple_quotes.rs

+6
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,16 @@ use crate::docstrings::Docstring;
2727
/// """Return the pathname of the KOS root directory."""
2828
/// ```
2929
///
30+
/// ## Formatter compatibility
31+
/// We recommend against using this rule alongside the [formatter]. The
32+
/// formatter enforces consistent quotes, making the rule redundant.
33+
///
3034
/// ## References
3135
/// - [PEP 257 – Docstring Conventions](https://peps.python.org/pep-0257/)
3236
/// - [NumPy Style Guide](https://numpydoc.readthedocs.io/en/latest/format.html)
3337
/// - [Google Python Style Guide - Docstrings](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings)
38+
///
39+
/// [formatter]: https://docs.astral.sh/ruff/formatter/
3440
#[violation]
3541
pub struct TripleSingleQuotes {
3642
expected_quote: Quote,

0 commit comments

Comments
 (0)