In my current properties file I have a very very long line of code for the exclusions.
Example, sonar.exclusions=src/main/scala/**/**/**/**/Main.scala,src/main/scala/**/**/**/**/Local.scala,src/main/scala/**/**/**/**/pa.scala,src/main/scala/**/**/**/**/infrato/*.scala,src/main/scala/**/**/**/**/dominate/settings/*.scala,src/main/scala/**/**/**/**/BotAppCall.scala,src/main/scala/**/**/**/**/**/**/**/**/com/*.scala
Is there a better way to format this instead of having this long line of code?
It just a horizontal scroll in my file, is there a way to concatenate it to be better formated?
That’s… a lot of wildcards. And there’s no reason for them, because just one ** looks through all directories. So if you really need to keep the initial source directory…
And, it’s not possible to break this up on different lines. However you can specify these in your Project Settings as well, under Analysis Scope, which accepts these on different lines. It ultimately is just sent to the scanner as comma separated values.
If you’re analyzing with the SonarScanner CLI you don’t have to worry much about modules.
If you’re saying that within the repository there is another/dominate/ folder indexed as source you don’t want to exclude, yes you’ll need to still specify /src/main/scala/
Does that make sense? Happy to clarify if you have questions.
Sorry I just have one last question. When reading the Narrowing the focus with analysis documentation I am unclear if a pattern like this will work. I want to exclude any sub packages under this folder, would **/parent/child/.* work or would it have to be like **/parent/child/*
**/parent/child/.* and **/parent/child/* probably(?) have the same effect. I haven’t tested it, but I assure you the latter is more common.
**/parent/child/* will exclude only files directly under the child directory. **/parent/child/** will exclude files recursively in the child directory (including any subdirectories)