Closed calda closed 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.11%. Comparing base (
5d0c8ce
) to head (ee80f90
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@calda this is great, thanks so much!
This PR makes two improvements to the
docComments
rule.First, this PR adds a
--doccomments preserve
options. When this option is enabled, it disables the part of the rule that converts doc comments into regular comments, so the rule will only ever convert regular comments into doc comments.Second, this PR updates the rule to preserve any regular comments preceding a block of grouped declarations. For example:
Since the comments refer to the code block as a whole, and not a specific property, it makes sense to use regular comments rather than doc comments (doc comments are fine too and also preserved in this case).
This is (finally!) a follow-up to https://github.com/nicklockwood/SwiftFormat/pull/1283#issuecomment-1271989083.