I’ve recently created a set of Roslyn analyzers that validate MS Build project files. Those analyzers report issues like regular Roslyn analyzers, but on .vbproj, .csproj and .props files.
By default, those issues do not show up in the SonarCloud reports (and I guess SonarCube, but I’ve never used it). What is the advised way to enable this?
Your issues aren’t showing up because the files aren’t included in analysis.
Dreadful hack ahead
If you edit the file extensions for a language to add the missing files it should get them included. The problem is that parsing those files would fail. I’m honestly not sure whether the parsing failure would kick them out of analysis or not. I’m thinking it might not. So if you could stand to see the parsing failures in your analysis logs, this might work for you.
What I don’t get though, who’s going to parse those files? SonarCloud? As Roslyn isn’t. Those analyzers just hook on to the RegisterCompilationAction, and analyze the project files themselves.