How to prevent Objective-C scanning on a swift project (sonarCloud + Bitbucket)

I want to scan my Swift project and exclude Objective-C scan.

I have a Bitbucket pipeline message that tells me to set these properties to prevent scanning
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-

But I can’t find where to set them in SonarCloud.

You can set them in your sonar-project.properties file. You can also set them in the UI:
Administration :arrow_right: General settings :arrow_right: Languages :arrow_right: C / C++ / Objective C

Hope this helps!

1 Like

I removed all the suffix in the Administration :arrow_right: General settings :arrow_right: Languages :arrow_right: C / C++ / Objective C but I still get the same error message.

my yml file is like this:

clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly

definitions:
caches:
sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
steps:
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarCloud
caches:
- sonar
script:
- pipe: sonarsource/sonarcloud-scan:1.2.1
- step: &check-quality-gate-sonarcloud
name: Check the Quality Gate on SonarCloud
script:
- pipe: sonarsource/sonarcloud-quality-gate:0.1.4

pipelines: # More info here: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
branches:
master:
- step: *build-test-sonarcloud
- step: *check-quality-gate-sonarcloud
pull-requests:
‘**’:
- step: *build-test-sonarcloud
- step: *check-quality-gate-sonarcloud

master:
  - step: *build-test-sonarcloud
  - step: *check-quality-gate-sonarcloud

pull-requests:
‘**’:
- step: *build-test-sonarcloud
- step: *check-quality-gate-sonarcloud

It was not working because I simply deleted all the suffix. I also needed to add suffix with the minus sign -
Tks for your help

Thank you! Glad to know it finally worked for you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.