This plugins is requiring the «scope» as mandatory package segment. This is compliant with the classic project structure.
However, with the modern project structure we made the scope optional. Our sonar plugin should therefore also accept the modern structure as valid architecture.
This plugins is requiring the
«scope»
as mandatory package segment. This is compliant with the classic project structure. However, with the modern project structure we made thescope
optional. Our sonar plugin should therefore also accept the modern structure as valid architecture.Therefore the
scope
needs to be made optional in the regex of the default config. Also DevonPackage needs to be changed such thatisValidScope()
also accepts no scope. Also add a new methodhasScope()
toDevonPackage
that checks if the package has no scope (scope isnull
or empty String). See also https://github.com/devonfw/sonar-devon4j-plugin/blob/master/src/main/java/com/devonfw/ide/sonarqube/common/api/config/DevonPackageImpl.javaAlso as part of this story all scope rules need to be checked that they do nothing if
package.hasScope()
returns false.Also change and extend the integration tests. For packaging see:
Here the test is expected to fail and
DevonArchitecturePackageCheck_NoScope.java
should now be compliant to the comment needs to be removed.