Open svendr opened 6 years ago
@svendr even after following all the steps you mentioned, I'm still getting 'The rule 'OCLint:compiler warning' does not exist.' error. --info--
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-plugin-api</artifactId>
<version>6.3</version>
</dependency>
@Nagesh-Chandan , @svendr Any updates on this issue? I 'm still getting the error even after following the steps.
The temp solution worked for me is to remove the tags from the oclint.xml file with rule= "compiler warning"
Yeah the generic "compiler warning" rule causes all kinds of trouble. You have to get rid of it.
Alternatively you can checkout the branch I developed my PR on, build the plugin-jar with it and deploy it to your sonar-server.
see https://github.com/svendr/sonar-objective-c/tree/feat/oclint-0.13-support
Just run SONARQUBE_HOME=XXX sh build-and-deploy.sh
from the root folder
Hi @svendr,
Support for OCLint 0.13 is now in release 0.6.2 of the plugin.
Let me know if it okay now.
Regards, Gilles
it doesn't work well with oclint 0.13 in release 0.6.2 of the plugin, and run-sonar.sh file contains many merge conflicts in tag 0.6.2 @zippy1978
env: xcode 9.1 Java 1.8.0_60 Sonar 6.7 Sonar-scanner 3.0.3.778 OCLint 0.13
error info: .ERROR: Error during SonarQube Scanner execution ERROR: The rule 'OCLint:compiler warning' does not exist. ERROR: ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging. ERROR - Command 'sonar-scanner ' failed with error code: 1
For those who looking for temp solution, I used the following py code to remove the warnings from the xml file. First run sh run-sonar.sh -v
, then run the below script on created xml file.
import xml.etree.ElementTree as ET
tree = ET.parse('oclint.xml')
root = tree.getroot()
for File in root.findall('file'):
if File[0].get('rule') == 'compiler warning':
print File[0].get('rule')
root.remove(File)
tree.write('oclint.xml')
and last, run sonar-scanner
.
I have trouble too with the OClint rules. However the workaround in #45 works temporary for me, but the next issue with the rule set is right here.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 13.302s
Final Memory: 13M/395M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: The rule 'OCLint:avoid private static members' does not exist.
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
++ returnValue=1
++ set +x
The mentioned rule above is present in OCLint since version 0.10.1 (Rule Overview: http://oclint-docs.readthedocs.io/en/stable/rules/design.html). Is there another work around or a new update in the line ?
Found a solution to avoid the trouble. Adding -disable-rule=AvoidPrivateStaticMembers
to the run-sonar.sh script did the trick.
This PR https://github.com/Backelite/sonar-objective-c/pull/50 solves it. Works on my machine 👍
As stated in #45, the plugin doesn't work well with oclint 0.13 and therefore with Xcode9. The ruleset should be updated to match the latest versions on http://docs.oclint.org/en/stable/rules
Executing
groovy updateOCLintRules.groovy
should be sufficient