Hi,
my IDE (Android Studio 3.1.3) complains about naming conventions for methods (squid:S00100) for unit tests. The violations, however, are not shown (correct!) in SonarQube.
What mechanisms do SonarLint employ to classify code as production code or test code?
My setup:
Multi-module Gradle project
Android Gradle Plugin 3.1.3
SonarQube Gradle plugin 2.6.2
I have correctly set the parameter sonar.sources and sonar.tests (looks fine in SonarQube)
SonarLint will check the project’s structure to figure out if a file is a test or not depending whether it belongs to a content root of type “Source” or “Tests”.
If you check your Project Structure, to which content root does the file in question belongs to?
I tried to reproduce with the latest versions of everything:
com.android.tools.build:gradle:3.5.3
Android Studio 3.5.3
SonarLint 4.4.0.14142
I did briefly see issues for rule S00100 in test files when initially opening the project, but they disappeared after running command Sync Project With Gradle Files, which correctly put the files under the Tests category.
Please feel free to bump/reopen this topic, or open a new one if you still see this issue with recent versions of SonarLint.