How can I integrate ReSharper's Dotsettings File in SonarQube?
Asked Answered
O

1

7

I have a C# Project with a ReSharper Dotsettings file. I want to configure Sonar so that it uses my Dotsettings file. In my Dottsettings file i disabled many Rules. How can I integrate this file in SonarQube?

This is my sonar-project.properties file (just the ReShaper part):

#ReSharper
sonar.resharper.mode=
sonar.resharper.dotSettings.path=MyProject/ReSharper7-Coding-Style.dotsettings

I also have the same problem with StyleCop. This is my sonar-project.properties file (just the StyleCop part):

# StyleCop 
sonar.stylecop.mode=
sonar.stylecop.projectFilePath=MyProject/Settings.StyleCop

fyi: I run the SonarQube analysis with Bamboo.

Ossification answered 9/6, 2015 at 8:47 Comment(1)
Sadly, I'm 99% sure that there is no existing functionality to integrate this. It would be really nice though.Plautus
H
6

You cannot use an existing .DotSettings file with SonarQube's R# plugin at the moment.

This feature however will be added in the upcoming release of the R# plugin, refer to http://jira.sonarsource.com/browse/SONARRSHPR-15 for details.

Note: The re-use reports mode was already supported in the past (with the C# plugin version 2.x), but has since been removed (since 3.x).

Hygrometer answered 10/6, 2015 at 12:56 Comment(15)
Will using a custom .DotSettings file and the reuse report method have any impact on the Quality Profile Rules settings enabled on the project being analyzed? I can't speak for the original poster, but I think the core of what is lacking here is a way for developers to syncronize their local Resharper settings with a Sonar Quality Profile Resharper rule set.Plautus
If you're using the reuse reports mode, then the R# rules enabled in the SonarQube quality profile won't really matter anymore. There also is this other ticket: jira.sonarsource.com/browse/SONARRSHPR-6 which would allow you to download a .DotSettings file from SonarQube, run inspectcode with it yourself, and then use the reuse reports mode.Hygrometer
That sounds pretty good. I have noticed that a DotSettings file is generated in the temporary working area with the current plugin, but it appears to have a severity level of "WARNING" for everything regardless of what the SonarQube rule severity is. Seems like if a mapping of SonarQube severities to Resharper severities was used to set those, we would be all set - We could have the option of not using reuseReports mode, and also have a DotSettings file available to distribute to developers for use on their desktops that reflects the SonarQube Rule set.Plautus
Big up for this feature, this is a deal breaker for us in order to use SonarQube, I mean without this we get all the warnings about fields not starting with underscores, etc. so the whole report is full of false reds.Airship
Hmm I found this feature, is this something else? jira.sonarsource.com/browse/SONARPLUGINS-3405Airship
Also, Jon Wright is describing a way how to do this in the comments here: wrightfully.com/sonarqube-net-resharper-plugin-beta-release/…, or this is something completely different?Airship
John Wright is referring to his own R# plugin, which was used along with the C# plugin 2.x. Now, that plugin is no longer active.Hygrometer
Oh okay. I felt something wasn't sqare :). Do you have an estimate on the SONARRSHPR-6 story? (By the way I see in the logs that there is already a default settings file passed to inspectcode like this: /profile=C:\...path to project...\resharper-sonarqube.DotSettings. Cannot this file be directly edited somehow?)Airship
It will be part of the R# plugin 1.1 release, which I expect will happen within a month from now.Hygrometer
@Dinesh-SonarSourceTeam any idea where I can download version 2.0 of the resharper plugin ? I see it was due to be released 06/23/2015 according to the info here: jira.sonarsource.com/browse/SONARRSHPR-15Bedridden
@Bedridden i expect it to become available next weekHygrometer
@Dinesh-SonarSourceTeam what does the resharper sonar configuration keys look like with plugin 2.0 ? I'm having a hard time getting the reusereport to work.Bedridden
@Bedridden in fact this new mode is only compatible with the MSBuild Runner 1.0 (and not Visual Studio Bootstrapper plugin) - which itself is not yet released. So you'll have to be a little bit patient.Hygrometer
@Dinesh-SonarSourceTeam are the changes in 1.3. I see [here] that a new release is underway but i dont see the resharper changes in its release note. [here]:jira.sonarsource.com/browse/SONARVS/fixforversion/11917/…Bedridden
Thanks - I've corrected that on Jira : There won't be any further version of the VS Bootstrapper plugin.Hygrometer

© 2022 - 2024 — McMap. All rights reserved.