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

@Suppress("MaxLineLength") not working for simple block comment inside class #3136

Closed
tmohme opened this issue Oct 8, 2020 · 1 comment · Fixed by #3164
Closed

@Suppress("MaxLineLength") not working for simple block comment inside class #3136

tmohme opened this issue Oct 8, 2020 · 1 comment · Fixed by #3164

Comments

@tmohme
Copy link

tmohme commented Oct 8, 2020

Expected Behavior

detekt should not flag the too-long line in a simple block-comment inside a class that is annotated with @Suppress("MaxLineLength").

Observed Behavior

detekt reports a "MaxLineLength" issue for the too-long lines within simple block-comments.
Interestingly, detekt does not report such an issue for too-long lines in KDoc-style block comments.

Steps to Reproduce

@Suppress("MaxLineLength")
class SomeClass {
    /*
     this line is too long and will be reported ------------------------------------------------------------------------------------------------>
     */

    /**
     this line is too long and won't be reported ----------------------------------------------------------------------------------------------->
     */
}

Context

Splitting the line in question is no option because it is a "citation" of a source-line of another project.
I'm using the KDoc-Style as a workaround but that's brittle as the block is obviously standing for itself and not directly documenting the next declaration, so the next one working on this piece of code might alter the comment style back again.

Your Environment

  • Version of detekt used: 1.14.1
  • Operating System and version: MacOS 10.14.6
@cortinico
Copy link
Member

I was able to reproduce.

Interestingly, detekt does not report such an issue for too-long lines in KDoc-style block comments.

What is actually happening is that the @Suppress("MaxLineLength") is considered only for the KDoc comment, and not for the regular comment.

Fix is here #3164

@arturbosch arturbosch added this to the 1.15.0 milestone Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants