Hello, I’m wondering how I might set the setting sonar.issue.ignore.block in the sonar-project.properties file?
I see from the SonarCloud UI the web form has the name for the block begin and end regex patterns as settings[sonar.issue.ignore.block][beginBlockRegexp] and settings[sonar.issue.ignore.block][endBlockRegexp], but this does not help me understand how to set this value in a .properties file.
We recommend users to use the UI to configure this, for best experience. Consider the configuration via sonar-project.properties as an undocumented hack, not official supported that may or may not work reliably, use at your own risk.
Well that’s entirely misleading. The documentation clearly shows properties that can be set in a project analysis configuration file. Shouldn’t the documentation for SonarCloud reflect that the project configuration files are a hack or not even mention them then?
Is the sonar-project.properties file being deprecated for SonarCloud projects?
You linked to the Analysis Parameters page, which doesn’t mention the sonar.issue.ignore.* properties, because this is not something we want to support. Consistent with that, the Narrowing the Focus page clearly says that the multi-value properties can only be set by the web interface. And again, it doesn’t mention the sonar.issue.ignore.* property names.
So I don’t see what is misleading here. The bottom line seems simple:
Feel free to use all the properties mentioned on the Analysis Parameters page
To ignore issues, follow the Narrowing the Focus page, using the UI to configure
Ah fair enough. Too bad the sonar-project.properties file doesn’t have parity with what can be set in the UI, it would have made it a great option to configure your project settings.
Fully agree, the setup/project config must be possible to be automated and having any UI option isn’t really helpful when working with hundreds of projects and pipelines …
I concur, @janos can you create an internal ticket for adding it to the official documentation?
This works perfectly fine via sonar-project.properties files and this should be the way to configure rule exclusions in the spirit of “configuration as code approach”.
There are use cases in which there is a multi-repository project that is e.g. Typescript based and we need to disable a rule for all repositories in that project (i.e. portfolio, not SQ project).
Disabling it via UI is impossible for directory layout reasons and also because the SQ (hosted) instance is multi-tenant - we want the projects to be self-responsible for their configuration and manage it exactly via the properties file
I’m late to this, but I cant find the UI so set this information. I also tried setting the properties file, and it didn’t work either. We are using Typescript, and the properties file is name “.sonarcloud.properties” … does that make a difference? I tried creating a properties file with several different names: “sonar-cloud.prproperties” , “sonar-project.properties” … none worked or had any effect.