Backelite / sonar-objective-c

Sonar Plugin for Objective-C
197 stars 76 forks source link

ERROR: The rule 'OCLint:compiler warning' does not exist. #45

Open andrewclaus opened 6 years ago

andrewclaus commented 6 years ago

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.

Any ideas what might be causing this? SonarQube 5.6

UPDATE: with some testing, OCLint 0.13 has this error, while OCLint 0.12 does not. Is there a new compiler warning that was introduced in 0.13 that does not yet exist in this sonar plugin?

CoreOne23 commented 6 years ago

@andrewclaus any updates?

andrewclaus commented 6 years ago

@CoreOne23 I ended up downgrading OCLint to 0.12 for now.

CoreOne23 commented 6 years ago

Oh, k. I just deleted the 'compiler warning' errors from oclint.xml in my file project folder. They were just warnings(like uipopovercontroller depreciated..), not errors. Now the analysis could work with 0.13 version. Waiting for the real solution. :(

zippy1978 commented 6 years ago

Hi @CoreOne23,

I updated OCLint rules fir 0.13 support in the version 0.6.2 of the plugin. Could you test again and tell me if it is okay ?

Gilles.

bkottcamp commented 6 years ago

Hi ,

It appears Clang ruleset violations are not mapped.

For example:

'MPMoviePlayerController' is deprecated: first deprecated in iOS 9.0 - Use AVPlayerViewController in AVKit.

Will result in ERROR: The rule 'OCLint:compiler warning' does not exist.

I'm wonder if that means OCLint 0.13 is defaulting to -enable-clang-static-analyzer?

keithpk commented 6 years ago

As a workaround you can edit your run-sonar.sh in the mean time to add:

-extra-arg=-Wno-everything

To the oclint-json-compilation-database command. Your final command should look like:

oclint-json-compilation-database -v -- -extra-arg=-Wno-everything -rc LONG_LINE=250 -max-priority-1 100000 -max-priority-2 100000 -max-priority-3 100000 -report-type pmd -o sonar-reports/oclint.xml

This will disable compiler warnings from being generated however.

Claes34 commented 6 years ago

Thanks @keithpk ! Looks like a good workaround for now

Arvin-J commented 6 years ago

@zippy1978 It's not okey! I had update to the latest version for sonar-objective-c. But also have the same issue

CoreOne23 commented 6 years ago

Hi @zippy1978 , I removed the obj C plugin and installed https://github.com/Backelite/sonar-swift/releases/tag/0.4.0, Still getting the compiler warning error. As I said earlier, I'm still deleting the compiler warning from xml to run the scanning successful.

CoreOne23 commented 6 years ago

-extra-arg=-Wno-everything - still giving me the error.

andrewclaus commented 6 years ago

@CoreOne23 If you are using the newest version of the swift/Objective-C plugin, make sure you have OCLint 0.13 (or if you have 0.13, maybe try downgrading to 0.12).