Summary
Some of our .swift files are failing to scan because the file contains a #warning() message. The error we get is that a string cannot be parsed, but it is not the string with the warning, but instead some line after the #warning line. A simple way to repro is to create a default project and add a #warning line anywhere in the code and see if it can be scanned.
Template below
I’m not sure what to fill the template out with, but here’s the best I can do without further guidance.
- Scanner version: 4.10.0
==============================================================================
Task : Run Code Analysis
Description : Run scanner and upload the results to the SonarQube server.
Version : 4.10.0
Author : sonarsource
Help : Version: 4.10.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
[More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
==============================================================================
- Error observed
##[error]ERROR: String is not parsed (file Foo/FileWithWarning.swift, line 10)
- Steps to reproduce
- Include #warning(“string doesn’t matter”) in a swift file.
- Potential workaround: Comment out warnings as TODOs so that sonarqube picks them up, but this will lose the value of #warning in XCode
- Scanner command used: tfs task - SonarSource.sonarqube.{GUID}.SonarQubeAnalyze@4
- In case of SonarCloud:
- ALM used Azure DevOps
- CI system used Azure DevOps