mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-26 18:06:43 +00:00
<!-- Thank you for contributing to Ruff/ty! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? (Please prefix with `[ty]` for ty pull requests.) - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> This PR fixes #7172 by suppressing the fixes for [docstring-missing-returns (DOC201)](https://docs.astral.sh/ruff/rules/docstring-missing-returns/#docstring-missing-returns-doc201) / [docstring-extraneous-returns (DOC202)](https://docs.astral.sh/ruff/rules/docstring-extraneous-returns/#docstring-extraneous-returns-doc202) if there is a surrounding line continuation character `\` that would make the fix cause a syntax error. To do this, the lints are changed from `AlwaysFixableViolation` to `Violation` with `FixAvailability::Sometimes`. In the case of `DOC201`, the fix is not given if the non-break line ends in a line continuation character `\`. Note that lines are iterated in reverse from the docstring to the function definition. In the case of `DOC202`, the fix is not given if the docstring ends with a line continuation character `\`. ## Test Plan <!-- How was it tested? --> Added a test case. |
||
|---|---|---|
| .. | ||
| _unrelated | ||
| D104 | ||
| all.py | ||
| bom.py | ||
| canonical_google_examples.py | ||
| canonical_numpy_examples.py | ||
| D.py | ||
| D100.ipynb | ||
| D200.py | ||
| D202.py | ||
| D208.py | ||
| D209_D400.py | ||
| D214_module.py | ||
| D215.py | ||
| D300.py | ||
| D301.py | ||
| D400.py | ||
| D400_415.py | ||
| D401.py | ||
| D402.py | ||
| D403.py | ||
| D410.py | ||
| D413.py | ||
| D417.py | ||
| sections.py | ||
| setter.py | ||
| sphinx.py | ||