What will happen if Dsonar.inclusions and Dsonar.exclusions all config to one file?

1 My environment

  • SonarQube 8.9
  • Scanner:sonar-scanner-4.7.0.2747-linux

2 what are you trying to achieve

my first question:

if inclusions and exclusions all config to one file, Will this file be analysed? like the follow command, all config test/testa.java

sonar-scanner-4.7.0.2747-linux/bin/sonar-scanner -Dsonar.inclusions=test/testa.java -Dsonar.exclusions='test/testa.java'

my second question:

Can i import the external issues to github pull request review page the sonar scanner command?

sonar-scanner-4.7.0.2747-linux/bin/sonar-scanner -Dsonar.host.url=XXX -Dsonar.github.repository=XXX -Dsonar.github.login=XXX -Dsonar.github.oauth=XXX -Dsonar.github.endpoint='http://test' -Dsonar.externalIssuesReportPaths=issues.json

Hi,

Welcome to the community!

Deliberately both including and excluding the same file spec is not something we’ve tested. My guess is that the files would be excluded, but it’s just a guess.

Regarding your second question, well… Generally we try to keep it to one question per thread. I’ll answer here, but I reserve the right to ask you to create a new thread with followups. And yes, you can import exteneral issues on the command line like that, as described in the docs.

 
HTH,
Ann

thanks Ann for your quick answer.