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.

Anaa
  • 1,191
  • 1
  • 9
  • 21
  • 1
    Sadly, I'm 99% sure that there is no existing functionality to integrate this. It would be really nice though. – ioscode Jun 09 '15 at 15:16

1 Answers1

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).

Dinesh Bolkensteyn
  • 2,971
  • 1
  • 17
  • 20
  • 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. – ioscode Jun 10 '15 at 17:45
  • 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: http://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. – Dinesh Bolkensteyn Jun 11 '15 at 05:35
  • 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. – ioscode Jun 11 '15 at 15:13
  • 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. – Mark Vincze Jun 12 '15 at 13:29
  • Hmm I found this feature, is this something else? http://jira.sonarsource.com/browse/SONARPLUGINS-3405 – Mark Vincze Jun 12 '15 at 13:46
  • Also, Jon Wright is describing a way how to do this in the comments here: http://www.wrightfully.com/sonarqube-net-resharper-plugin-beta-release/#comment-1184764573, or this is something completely different? – Mark Vincze Jun 12 '15 at 14:58
  • 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. – Dinesh Bolkensteyn Jun 15 '15 at 06:10
  • 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?) – Mark Vincze Jun 15 '15 at 09:32
  • It will be part of the R# plugin 1.1 release, which I expect will happen within a month from now. – Dinesh Bolkensteyn Jun 15 '15 at 10:00
  • @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: http://jira.sonarsource.com/browse/SONARRSHPR-15 – delloPiro Jun 26 '15 at 19:16
  • @delloPiro i expect it to become available next week – Dinesh Bolkensteyn Jun 28 '15 at 17:22
  • @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. – delloPiro Jul 01 '15 at 00:05
  • @delloPiro 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. – Dinesh Bolkensteyn Jul 02 '15 at 14:14
  • @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]:http://jira.sonarsource.com/browse/SONARVS/fixforversion/11917/?selectedTab=com.atlassian.jira.jira-projects-plugin:version-summary-panel – delloPiro Jul 17 '15 at 20:07
  • Thanks - I've corrected that on Jira : There won't be any further version of the VS Bootstrapper plugin. – Dinesh Bolkensteyn Jul 20 '15 at 11:46