# How to set sonar.issue.ignore.block in sonar-project.properties

**URL:** <https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943>\
**Category:** SonarQube Cloud\
**Tags:** configuration, scanner\
**Created:** [June 18, 2019, 3:44pm UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943 "2019-06-18T15:44:56Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![dschnare](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dschnare/32/4634_2.png) [@dschnare](https://community.sonarsource.com/u/dschnare)\
**Post date:** [June 18, 2019, 3:44pm UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/1 "2019-06-18T15:44:56Z")

</div>

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.

Thanks

---

<div class="post-metadata">

**Author:** ![dschnare](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dschnare/32/4634_2.png) [@dschnare](https://community.sonarsource.com/u/dschnare)\
**Post date:** [June 19, 2019, 8:11pm UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/4 "2019-06-19T20:11:27Z")

</div>

> [@dschnare](#):
>
> sonar.issue.ignore.block

Interesting…

> [@Documentation about "Ignore Issues" seems to be wrong or outdated](https://community.sonarsource.com/t/documentation-about-ignore-issues-seems-to-be-wrong-or-outdated/3353):
>
> [https://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-IgnoreIssues](https://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-IgnoreIssues) claims Note that the properties below can only be set through the web interface because they are multi-valued But Google actually finds example configurations like [cornipickle/sonar-project.properties at master · liflab/cornipickle · GitHub](https://github.com/liflab/cornipickle/blob/master/sonar-project.properties) that do # Ignore a few rules sonar.issue.ignore.multicriteria=e1,e2,e3,e4,e5 # Field names should comply with a naming convention sonar.issue.ignore.multicriteri…

And then there is this

> <https://stackoverflow.com/questions/21825469/configure-sonar-sonar-issue-ignore-multicriteria-through-maven>

So. I am assuming the docs over here ( [Narrowing the focus with an analysis scope](https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/#NarrowingtheFocus-IgnoreIssues) ) are just not accurate.

---

<div class="post-metadata">

**Author:** ![janos](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/janos/32/60_2.png) [@janos](https://community.sonarsource.com/u/janos)\
**Post date:** [June 21, 2019, 9:22am UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/5 "2019-06-21T09:22:51Z")

</div>

Hi @dschnare,

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.

Cheers,  
Janos

---

<div class="post-metadata">

**Author:** ![dschnare](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dschnare/32/4634_2.png) [@dschnare](https://community.sonarsource.com/u/dschnare)\
**Post date:** [June 21, 2019, 7:11pm UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/6 "2019-06-21T19:11:14Z")

</div>

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?

[https://sonarcloud.io/documentation/analysis/analysis-parameters/](https://sonarcloud.io/documentation/analysis/analysis-parameters/)

For anyone using project configuration files:

```
sonar.issue.ignore.allfile=e1
sonar.issue.ignore.allfile.e1.fileRegexp=@sonar-disable
sonar.issue.ignore.block=e2
sonar.issue.ignore.block.e2.beginBlockRegexp=@sonar-ignore
sonar.issue.ignore.block.e2.endBlockRegexp=@end

```

Are examples of how to set sonar.issue.ignore.allfile and sonar.issue.ignore.block.

---

<div class="post-metadata">

**Author:** ![janos](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/janos/32/60_2.png) [@janos](https://community.sonarsource.com/u/janos)\
**Post date:** [June 22, 2019, 12:08pm UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/7 "2019-06-22T12:08:04Z")

</div>

> [@dschnare](#):
>
> 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?

You linked to the [Analysis Parameters](https://sonarcloud.io/documentation/analysis/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](https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/#NarrowingtheFocus-IgnoreIssues) 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](https://sonarcloud.io/documentation/analysis/analysis-parameters/) page
- To ignore issues, follow the [Narrowing the Focus](https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/#NarrowingtheFocus-IgnoreIssues) page, using the UI to configure

Do let me know what I’m missing.

> [@dschnare](#):
>
> Is the sonar-project.properties file being deprecated for SonarCloud projects?

Not for the moment.

---

<div class="post-metadata">

**Author:** ![dschnare](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dschnare/32/4634_2.png) [@dschnare](https://community.sonarsource.com/u/dschnare)\
**Post date:** [June 25, 2019, 2:45pm UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/8 "2019-06-25T14:45:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kusigun](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/kusigun/32/17822_2.png) [@kusigun](https://community.sonarsource.com/u/kusigun)\
**Post date:** [December 18, 2020, 2:08pm UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/9 "2020-12-18T14:08:03Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![warden](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/warden/32/7737_2.png) [@warden](https://community.sonarsource.com/u/warden)\
**Post date:** [August 3, 2021, 8:31am UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/13 "2021-08-03T08:31:58Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![joshgo](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/joshgo/32/37460_2.png) [@joshgo](https://community.sonarsource.com/u/joshgo)\
**Post date:** [September 23, 2022, 1:49am UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/14 "2022-09-23T01:49:45Z")

</div>

Where in the UI do we specify the “block expressions”? I’ve tried to going to Analysis Scope, but I dont see the screen. And I’m set as ADMIN.

This is the documentation I am following: [Analysis Scope | SonarCloud Docs](https://docs.sonarcloud.io/advanced-setup/analysis-scope/)

---

<div class="post-metadata">

**Author:** ![joshgo](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/joshgo/32/37460_2.png) [@joshgo](https://community.sonarsource.com/u/joshgo)\
**Post date:** [September 23, 2022, 1:31pm UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/15 "2022-09-23T13:31:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon80914724](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@anon80914724](https://community.sonarsource.com/u/anon80914724)\
**Post date:** [May 18, 2025, 9:30pm UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/16 "2025-05-18T21:30:58Z")

</div>

Hello, I used regular expressions to ignore a block of code. I set these expressions in both properties file and also in the UI. When I tried those to ignore in the source file it does not work. Can you please let me know if this is deprecated? BTW, I am using C language.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [May 20, 2025, 8:09am UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/17 "2025-05-20T08:09:49Z")

</div>

@anon80914724 Please do not bump old threads. I will close this one.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [May 20, 2025, 8:09am UTC](https://community.sonarsource.com/t/how-to-set-sonar-issue-ignore-block-in-sonar-project-properties/10943/18 "2025-05-20T08:09:51Z")

</div>

Closed on May 20, 2025, 8:09am UTC


