Activating customized rules in JSON Plugin

Hi SonarSource Community,

I am using SonarQube version 6.7.6 and we are working on validating json files.
I came across a json plugin that is compatible with my version. However, I cannot activate the customized rules I created on it.
Is there a way I can activate it and use those rules I created on validating my json files?

I hope you’ll help me with this one.
Your help is very much appreciated.

Thank you so much!

Regards,
Phoebe

Hey there.

racodond/sonar-json-plugin is an old, unmaintained plugin. It’s unlikely you’ll find support for it.

Please note that SonarQube v6.7 LTS is a very old version of SonarQube (relased in 2017). You should upgrade to v7.9 LTS in order to get ready to upgrade to v8.9 LTS (coming next week!)

1 Like

Hi Colin,

Thank you for your quick response.
I was able to create customized rules on json plugin and activate it. However, I encountered a problem.
Sonarqube won’t accept /s for space on my regex. I tried [[:space:]] for POSIX as well, it won’t work.

Do you have an idea of what should I use instead? For validating json files with space in between.

Thank you in advance for your help! Really appreciate it. :slight_smile:

It’s really going to be specific to racodond/sonar-json-plugin. Maybe the maintainer will be kind enough to respond! But it’s an unmaintained project, so the chances aren’t too likely. Sorry we can’t be more help here.

1 Like

Hi Colin,

I have one last question.
I have created a customized rule under the Rule template of a plugin. I’ve noticed, the regex I created with a whitespace character won’t work. Can SonarQube version 6.7.6 accepts regex with [\s] on it?

Again, thank you so much for your quick response!

Regards,
Phoebe

Hey Phoebe,

It’s not a SonarQube question, it’s 100% dependent on the analyzer behavior (the unmaintained JSON plugin you’ve installed). You’ll have to find out how it works.

1 Like

Oh, okay.
At least now, I can break down the causes.

Thank you so much again!
Your help is greatly appreaciated.

Regards,
Phoebe