sonar-swift icon indicating copy to clipboard operation
sonar-swift copied to clipboard

ERROR: The rule 'OCLint:compiler warning' does not exist

Open kurabi opened this issue 6 years ago • 6 comments

If a build has a compilation warning, Sonar is not able to digest the XML file that OCLint produces.

INFO: Sensor org.sonar.plugins.objectivec.violations.oclint.OCLintSensor INFO: Processing OCLint report sonar-reports/oclint_report.xml INFO: ------------------------------------------------------------------------ INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ INFO: Total time: 8.993s INFO: Final Memory: 49M/321M INFO: ------------------------------------------------------------------------ ERROR: Error during SonarQube Scanner execution ERROR: The rule 'OCLint:compiler warning' does not exist.

This PR fixes it for the deprecated version of this project: https://github.com/Backelite/sonar-objective-c/issues/45

kurabi avatar Sep 12 '18 18:09 kurabi

Thanks for bringing up this issue. I just ran into it myself and I was about to make an issue/pull request that is a duplicate of the one you linked. I will get a pull request started now.

andrewclaus avatar Sep 14 '18 21:09 andrewclaus

PR here: https://github.com/Backelite/sonar-swift/pull/168

andrewclaus avatar Sep 14 '18 21:09 andrewclaus

https://github.com/Backelite/sonar-swift/pull/163 should fix the issue. Awaiting merge.

gaelfoppolo avatar Aug 10 '19 17:08 gaelfoppolo

I understand the issue but the problem is somewhere else IMO.

Compiler warning can be anything from deprecated method usage to #warning placed by developers in the source code.

SonarQube works with predefined rules, integrating this rule doesn't help in knowing what would be wrong because it's not possible (as much as i know) to provide contextual and additional informations about a rule violation.

To me, the right way would be to either:

  • not have compiler warnings in the oclint report (check with OClint maybe?)
  • clean the compiler warnings from the oclint report
  • ignore unknown rules in the OCLint parser in the plugin

davidy4ng avatar Aug 20 '19 12:08 davidy4ng

In order to fix this we should consider using this option: -extra-arg=-Wno-everything.

gaelfoppolo avatar Sep 03 '19 18:09 gaelfoppolo

Same issue here -extra-arg=-Wno-everything doesn't work in my case :(

deimian86 avatar Oct 04 '19 07:10 deimian86