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

Semicolons (at end of line) in KDoc aren't allowed on lines containing references, but should be #362

Closed
erikhuizinga opened this issue Mar 29, 2019 · 2 comments

Comments

@erikhuizinga
Copy link

erikhuizinga commented Mar 29, 2019

Ktlint doesn't accept the following:

/**
 * [x];
 */

Ktlint doesn't allow semicolons at the end of a KDoc line. However, they are perfectly fine, as they are a natural language token, not a Kotlin token.

It seems this only happens when the KDoc contains references to code, e.g..: [x].
Note that just formatted code with a semicolon, e.g. `x`;, is accepted by ktlint.

The suggestion is to accept EOL semicolons in KDoc lines that contain Kotlin code.

@NightlyNexus
Copy link
Contributor

NightlyNexus commented Mar 30, 2019

I couldn't reproduce this error.
Can you make a test for NoSemicolonsRuleTest or link to a minimum reproducible example?

@erikhuizinga
Copy link
Author

You're right, ktlint runs without problems on my original example. I'm editing it right away! Save it to file.kt and run ktlint file.kt, which results in /path/to/file.kt:2:7: Unnecessary semicolon.

@erikhuizinga erikhuizinga changed the title Semicolons (at end of line) in KDoc aren't allowed, but should be Semicolons (at end of line) in KDoc aren't allowed on lines containing references, but should be Mar 30, 2019
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

No branches or pull requests

2 participants