Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't alter doc line comments unnecessarily. #581

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

allevato
Copy link
Member

@allevato allevato commented Aug 7, 2023

Since we introduced the new logic to parse doc comments, the UseTripleSlashForDocumentationComments rule started inadvertently normalizing comments that were already doc line comments. For example,

///
///     Foo
///

would have its initial blank line(s) and leading spaces removed, leaving this:

/// Foo
///

While we may want to be opinionated at some point about how such comments are formatted, it's not a desired consequence of this rule; the name on the tin doesn't say anything about altering comments that already meet the requirement, so now we make sure to leave them alone if they're already doc line comments.

Since we introduced the new logic to parse doc comments, the
`UseTripleSlashForDocumentationComments` rule started inadvertently
normalizing comments that were already doc line comments. For example,

```swift
///
///     Foo
///
```

would have its initial blank line(s) and leading spaces removed,
leaving this:

```swift
/// Foo
///
```

While we may want to be opinionated at some point about how such
comments are formatted, it's not a desired consequence of *this*
rule; the name on the tin doesn't say anything about altering
comments that already meet the requirement, so now we make sure
to leave them alone if they're already doc line comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant