- Eclipse: 4.11.0 (2019-03)
- SonarLint for Eclipse 4.1.0.201901311043
Given
- a Java project with only src/main/java
- Some files in src/main/java that should be treated as test sources (being rather testutils such as abstract test superclasses)
- A regex for test file patterns is configured for these files in the preferences as described in the FAQ
When
- Analysis is done and test file classification is executed (see sonarlint-eclipse/TestFileClassifier.java at master · SonarSource/sonarlint-eclipse · GitHub)
Then unexpectedly
- Regex is not respected but only the result of the IFileTypeProvider
- Files are classified as NOT TEST.
But should be
- Files are classified as TEST
Suggested change in rules for classification
- if in test-Folder =>treat as TEST
- if in MAIN-folder or UNKNOWN-folder => treat as MAIN unless regex matches