You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
It appears that the plugin has no rules applied to test cases when using sonar property sonar.tests (If it does then we consider it too few rules for our liking, as we have never hit a violation in this circumstance)
Instead we include test cases as sonar.sources, which, of course, brings some new problems.
There is an issue in the previous maintainer's sonar-groovy project about this, which shows others are including tests as source: pmayweg/sonar-groovy#89
Sonarqube itself seems to have little to no functionality or information what rules are applied against tests vs sources so I presume this distinction is up to the various language plugins?
If I could wish for the functionality, I would wish it to be based on the label applied to the rule (as this is under user control, however I suspect labels are for display filtering only and don't work this way)
I did notice however that in some of the descriptions of the rules, for example "InstanceofRule" there is text such as this: By default, the rule does not analyze test files. This rule sets the default value of the doNotApplyToFilesMatching property to ignore file names ending in 'Spec.groovy', 'Test.groovy', 'Tests.groovy' or 'TestCase.groovy'.
Since the file where I hit this violation ends with "Spec.groovy", I am curious if there is any user-level control over this parameter that I can exercise to disable certain rules for test cases?
The text was updated successfully, but these errors were encountered:
This plugin seems to deliberately restrict itself to the main sources. On the other hand, rules are currently not classified if they apply to main source, test source or both - So removing this restriction will open up the next chore: Classifying all of CodeNarc's rules into those categories...
(Using sonar-groovy 1.4 and Sonarqube 7.9)
It appears that the plugin has no rules applied to test cases when using sonar property
sonar.tests
(If it does then we consider it too few rules for our liking, as we have never hit a violation in this circumstance)Instead we include test cases as
sonar.sources
, which, of course, brings some new problems.There is an issue in the previous maintainer's sonar-groovy project about this, which shows others are including tests as source:
pmayweg/sonar-groovy#89
Sonarqube itself seems to have little to no functionality or information what rules are applied against tests vs sources so I presume this distinction is up to the various language plugins?
If I could wish for the functionality, I would wish it to be based on the label applied to the rule (as this is under user control, however I suspect labels are for display filtering only and don't work this way)
I did notice however that in some of the descriptions of the rules, for example "InstanceofRule" there is text such as this:
By default, the rule does not analyze test files. This rule sets the default value of the doNotApplyToFilesMatching property to ignore file names ending in 'Spec.groovy', 'Test.groovy', 'Tests.groovy' or 'TestCase.groovy'.
Since the file where I hit this violation ends with "Spec.groovy", I am curious if there is any user-level control over this parameter that I can exercise to disable certain rules for test cases?
The text was updated successfully, but these errors were encountered: