SonarLint doesn't display / hightlight issues in Eclipse Oxygen

2,228 views
Skip to first unread message

vasheck

unread,
Mar 31, 2018, 7:23:17 PM3/31/18
to SonarLint
I installed SonarLint plugin in Eclipse but it doesn't appear to work for me. I don't see any issues highlighted in the code or listed in the "on-the-fly" tab.

I posted detailed information about the issue on StackOverflow but I am not getting any feedback. And I came across this forum.
https://stackoverflow.com/questions/49583392/sonarlint-plugin-not-working-in-eclipse-oxygen

Hopefully, I will have more luck here.

In short, I have a working instance of SonarQube and Sonar Scanner. If I create a simple Java project in Eclipse (Oxygen v3) and run the sonar-scanner command from the location of the sonar-project.properties file, the Java project (report) is created in SonarQube without issues. I can see all issues listed in the SonarQube but there are no issues listed/highlighted in Eclipse.

I do have "Run SonarLint automatically" enabled and I tried to "Analyze" the project manually but no luck.

Please, refer to the link for additional details. Any tips or suggestions how to resolve this issue would be appreciated!

Thank you!





Jonathan Marchand

unread,
Apr 1, 2018, 2:43:55 AM4/1/18
to vasheck, SonarLint
Hi,

Sonarlint in Eclipse has no way to see which files are tests and which are sources, so it uses a simple regexp, looking for the keyword test anywhere on the path of the file.
From your screenshots, your file is in a folder named test, so only the test rules are applied to it.

Try to place the file in a package without the word test in the path, or check in Sonarlint options to see if you can edit the regexp.

Best regards, 
Jonathan



--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/7f6fe625-ce91-4b6b-b298-22bcf1775553%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Julien HENRY

unread,
Apr 3, 2018, 3:05:53 AM4/3/18
to Jonathan Marchand, vasheck, SonarLint
Jonathan is correct.

As a complement, in Eclipse Photon, there is now a native concept of test folders/classpath in JDT. It means we will soon be able to rely on this instead of using the regexp (at least for Java projects).

++

Julien Henry | SonarSource

Developer

https://sonarsource.com


2018-04-01 8:43 GMT+02:00 Jonathan Marchand <jonathan....@gmail.com>:
Hi,

Sonarlint in Eclipse has no way to see which files are tests and which are sources, so it uses a simple regexp, looking for the keyword test anywhere on the path of the file.
From your screenshots, your file is in a folder named test, so only the test rules are applied to it.

Try to place the file in a package without the word test in the path, or check in Sonarlint options to see if you can edit the regexp.

Best regards, 
Jonathan


Le dim. 1 avr. 2018 à 01:23, vasheck <vase...@gmail.com> a écrit :
I installed SonarLint plugin in Eclipse but it doesn't appear to work for me. I don't see any issues highlighted in the code or listed in the "on-the-fly" tab.

I posted detailed information about the issue on StackOverflow but I am not getting any feedback. And I came across this forum.
https://stackoverflow.com/questions/49583392/sonarlint-plugin-not-working-in-eclipse-oxygen

Hopefully, I will have more luck here.

In short, I have a working instance of SonarQube and Sonar Scanner. If I create a simple Java project in Eclipse (Oxygen v3) and run the sonar-scanner command from the location of the sonar-project.properties file, the Java project (report) is created in SonarQube without issues. I can see all issues listed in the SonarQube but there are no issues listed/highlighted in Eclipse.

I do have "Run SonarLint automatically" enabled and I tried to "Analyze" the project manually but no luck.

Please, refer to the link for additional details. Any tips or suggestions how to resolve this issue would be appreciated!

Thank you!





--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/CAOksLKNhkvRBKfqdp1w1m952-USnonSgYNH6cqox9aSZL6iuLQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages