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

Invalid line value on TrailingWhitespace error with gradle #1082

Closed
bagage opened this issue Sep 3, 2018 · 2 comments
Closed

Invalid line value on TrailingWhitespace error with gradle #1082

bagage opened this issue Sep 3, 2018 · 2 comments
Milestone

Comments

@bagage
Copy link
Contributor

bagage commented Sep 3, 2018

Expected Behavior

When using the gradle plugin, it seems that the line number is invalid for some TrailingWhitespace error but it works as expected when executing the jar (it returns the proper line).

When using gradle, I'm expecting line 6 to be reported, similar to when using the jar.

$ ./gradlew detektCheck 
[...]
Ruleset: style - 5min debt
	TrailingWhitespace - [test.kt] at /tmp/test.kt:6:38

Current Behavior

But instead, line 3 is reported:

$ ./gradlew detektCheck 
[...]
Ruleset: style - 5min debt
        TrailingWhitespace - [test.kt] at /tmp/test.kt:3:23

Steps to Reproduce (for bugs)

Use this file:

package demo

fun main(args: Array<String>) {
    println("""
        Hello, world!
        here is a trailing space --> 
        """)
}
  1. Run java -jar detekt-cli-1.0.0.RC8-all.jar -i test.kt -> line 6 is reported (OK)
  2. Run ./gradlew detektCheck -> line 3 is reported (NOK)

Your Environment

  • Version used: 1.0.0-RC8
@schalkms
Copy link
Member

schalkms commented Sep 3, 2018

Thanks for reporting this. This issue is already fixed and will be included in the new detekt version.
Duplicate #1030

@schalkms schalkms closed this as completed Sep 3, 2018
@arturbosch arturbosch added this to the RC9 milestone Sep 10, 2018
@lock
Copy link

lock bot commented Jun 20, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants