Include/Exclude multiple directories while scanning

76 views
Skip to first unread message

Vinayak Prabhu

unread,
Jan 21, 2017, 7:50:54 AM1/21/17
to SonarLint
Is there any way to include or exclude a bunch of directories in the --src or --exclude command?

My project structure is like this:
/src/main/java/com/hello/nominate/domain/xx.java
/src/main/java/com/hello/nominate/service/xx.java
/src/main/java/com/hello/nominate/controller/xx.java
/src/main/java/com/hello/nominate/config/xx.java

If I want to scan just the service and controller files, I am doing it in 2 separate commands:
sonarlint.bat -u -X --tests "src/test/**" --src "src/main/java/com/hello/nomination/controller/**"
sonarlint.bat -u -X --tests "src/test/**" --src "src/main/java/com/hello/nomination/service/**"

Is there any way to include both the packages as part of the single scan? Separating them with commas don't seem to work.

Vinayak Prabhu

unread,
Jan 21, 2017, 10:06:26 AM1/21/17
to SonarLint
Nvm, we can use Glob syntax in the command as well So, {controller,service} works perfectly.
Reply all
Reply to author
Forward
0 new messages