Suggestion to create own custom rule in groovy

198 views
Skip to first unread message

roadies...@gmail.com

unread,
Sep 16, 2015, 2:50:38 AM9/16/15
to SonarQube
Hi All,

I have to create own custom rules for Groovy in SonarQube. So, i there any way to create custom rules for Groovy.
Please let me know.

Regards,
Raj

Nicolas Peru

unread,
Sep 16, 2015, 3:29:18 AM9/16/15
to roadies...@gmail.com, SonarQube
Hi, 

Short answer : no. 
Longer answer : Groovy plugin is relying on an external rule engine called CodeNarc : http://codenarc.sourceforge.net/ Codenarc allows to write custom rule for groovy but the sonar groovy plugin does not provide a way to import them in quality profile and so execute them. 

Cheers, 

Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/dee1fdcb-9710-46ae-b537-780b6df490dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

roadies...@gmail.com

unread,
Sep 16, 2015, 5:48:55 AM9/16/15
to SonarQube, roadies...@gmail.com
Thanks Nicolas..!!

So, there is no way to create custom rule for groovy in SonarQube.

Regards,
Raj

colors...@gmail.com

unread,
Oct 20, 2015, 1:17:34 PM10/20/15
to SonarQube, roadies...@gmail.com
Hi Nicolas/Raj,

Is there any workaround for this ? Please let me know.

Thanks
Rajesh

Nicolas Peru

unread,
Oct 28, 2015, 4:56:40 AM10/28/15
to colors...@gmail.com, SonarQube, Raj Rao
Hi, 

As of today no real workaround unless you develop your own plugin. 

Cheers,

Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com


brian...@gmail.com

unread,
Mar 18, 2016, 1:48:43 PM3/18/16
to SonarQube, colors...@gmail.com, roadies...@gmail.com
I assume it would possible to include the custom rules in the sonar plugin if you build it from source and patch it, correct?

Nicolas Peru

unread,
Apr 11, 2016, 7:30:05 AM4/11/16
to brian...@gmail.com, SonarQube, colors...@gmail.com, roadies...@gmail.com
That should be doable indeed. But I think this is rather convoluted. 

Cheers, 


For more options, visit https://groups.google.com/d/optout.
--
Reply all
Reply to author
Forward
0 new messages