mirror of
https://github.com/astral-sh/ruff
synced 2026-01-11 08:34:29 -05:00
This PR implements `W505` (`DocLineTooLong`), which is similar to `E501` (`LineTooLong`) but confined to doc lines. I based the "doc line" definition on pycodestyle, which defines a doc line as a standalone comment or string statement. Our definition is a bit more liberal, since we consider any string statement a doc line (even if it's part of a multi-line statement) -- but that seems fine to me. Note that, unusually, this rule requires custom extraction from both the token stream (to find standalone comments) and the AST (to find string statements). Closes #1784.