Detection of InputFile.Type.MAIN and InputFile.Type.TEST

37 views
Skip to first unread message

Thibault Falque

unread,
Jan 21, 2018, 5:52:38 PM1/21/18
to SonarQube
Dear all,
 
In the sonar-golang plugin, we need to differentiate the source code files and test files.

In the sonarqube api there is an enumeration InputFile.Type with MAIN and TEST values. How to use it for the files ending with ".go" become InputFile.Type.MAIN and files ending with "_test.go" become InputFile.Type.TEST during indexing?

Regards,
Thibault Falque.

Pierre-Yves Nicolas

unread,
Jan 22, 2018, 2:50:13 AM1/22/18
to Thibault Falque, SonarQube
Hi Thibault,

It can be configured at project level, for example:

sonar.sources=src
sonar.tests=src
sonar.test.inclusions=**/*_test.go

I don't think that the plugin can define itself which files should be considered as tests.

Regards,
Pierre-Yves


--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/e1cabcc0-4dbb-4fc9-8b17-0c48e1065eec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thibault Falque

unread,
Jan 22, 2018, 4:10:43 PM1/22/18
to SonarQube
Hi Pierre-Yves,

Thanks for your quick answer.

I will test.

Regards,
Thibault.
Reply all
Reply to author
Forward
0 new messages