octo-technology / sonar-objective-c

Sonar Plugin for Objective C
517 stars 208 forks source link

Be able to customize the checks #81

Open henri-tremblay opened 9 years ago

henri-tremblay commented 9 years ago

Usually, a Sonar plugin allows to configure the checks in the quality profile. This plugin doesn't.

I would like to be able to specify things like the line length and variable length.

cyrilpicat commented 9 years ago

that's right. In other plugins, this is done through Quality Profiles/Rules via rules parameters. For example look at the Java plugin and the rule 'Methods should not have too many parameters'.

But OCLint rules in this Objective-C plugin don't have any parameters. This is due to the architecture of the Objective-C plugin, because OCLint is launched outside of the plugin via a Shell script. Notice that OCLint already have the ability to parameter a few rules: http://docs.oclint.org/en/dev/customizing/rules.html.

Meanwhile you can still get what you want by "hacking" the run-sonar.sh script and adding the argument '-rc LONG_LINE=120' in the oclint command line (line 291, oclint-json-compilation-database).

And in mid-term, this issue can be overcomed by extracting Sonar parameters from the Shell script, I will have a look at how this could be done, but it should not be that hard.