comments-indentation¶
What this rule does¶
Requires that standalone comment lines line up with the surrounding content. A comment must share the indentation of the line that follows it (or, when at the end of the file, the line that precedes it).
Why this matters¶
- Visual grouping. Comments that float at unrelated indent levels confuse readers about which block they describe.
- Diff stability. Aligning comments with their content makes it obvious when an edit moves or breaks the relationship.
Configuration¶
This rule has no options beyond level.
Examples¶
Allowed¶
Reported¶
After ryl --fix¶
Automatic fixing¶
ryl --fix reindents standalone comment lines to match the line that
follows them. Disable with:
Related rules¶
comments— controls the formatting of comment text itself.indentation— the general indentation rule these comments are aligned against.