-
Notifications
You must be signed in to change notification settings - Fork 16
Description
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.
Therefore the scope needs to be made optional in the regex of the default config.
Also DevonPackage needs to be changed such that isValidScope() also accepts no scope. Also add a new method hasScope() to DevonPackage that checks if the package has no scope (scope is null 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.java
Also 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:
- https://github.com/devonfw/sonar-devon4j-plugin/blob/master/src/test/files/packaging/DevonArchitecturePackageCheck_NoScope.java
- https://github.com/devonfw/sonar-devon4j-plugin/blob/master/src/test/java/com/devonfw/ide/sonarqube/common/impl/check/packaging/DevonArchitecturePackageCheckTest.java
Here the test is expected to fail and DevonArchitecturePackageCheck_NoScope.java should now be compliant to the comment needs to be removed.