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

Convert ValidateDocumentationComments to a formatter #955

Closed

Conversation

natecook1000
Copy link
Member

This change enables the ValidateDocumentationComments rule to make the swap between outlined and separated parameter descriptions, when necessary. Other diagnostics require user intervention, so they're still only linted.

This change enables the `ValidateDocumentationComments` rule to
make the swap between outlined and separated parameter descriptions,
when necessary. Other diagnostics require user intervention, so
they're still only linted.
@natecook1000
Copy link
Member Author

Only a draft since it doesn't handle block documentation comments yet. Is this a direction that makes sense? I'm doing the processing directly on the trivia collection, since converting the docs to Markdown doesn't seem to preserve the actual text structure in a way that we can make only minimal changes.

@rauhul
Copy link
Member

rauhul commented Mar 6, 2025

Awesome PR! ❤️

@allevato
Copy link
Member

allevato commented Mar 6, 2025

I'm doing the processing directly on the trivia collection, since converting the docs to Markdown doesn't seem to preserve the actual text structure in a way that we can make only minimal changes.

FWIW, the motivation for using the Markdown module in swift-format wasn't just to parse doc comments, but also to apply a canonical formatting to them one day. So I wouldn't mind if that was a prerequisite for doing these kinds of transformations, especially if it makes the implementation easier/cleaner because you'd be operating on Markdown nodes instead of the raw trivia.

@natecook1000
Copy link
Member Author

Thanks @allevato! Superseded by #959.

@natecook1000 natecook1000 deleted the validate-comments-formatter branch March 7, 2025 18:56
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.

3 participants