SonarLint doesn't appear to work with XML file and custom XML rule

841 views
Skip to first unread message

matad...@googlemail.com

unread,
May 4, 2017, 6:14:29 AM5/4/17
to SonarLint
Hi

We're using SonarLint 3 in Eclipse with some custom XPath rules defined for XML files. Violations are reported fine through the sonar central server however when I add a violation locally it isn't picked up. It's partially related to 


Where I mentioned the SonarXML plug in is supposedly supported in SonarLint now from the documentation. SonarLint does appear to try to analyze this file as we see from the log entries

SonarLint analysis of file /myproject/clientTestRoute.xml...


Available languages:
  * JavaScript => "js"
  * Java => "java"
Start analysis
Declared extensions of language JavaScript were converted to js: file:**/*.js
Declared extensions of language Java were converted to java: file:**/*.java,file:**/*.jav
Quality profiles:
  * java: java-testpurejava-25438 (377 rules)
  * js: js-sonar-way-40644 (43 rules
Index files
1 files indexed
'JavaScript Squid Sensor' skipped because there is no related file in current project
'JavaSquidSensor' skipped because there is no related file in current project
Execute Sensor: XmlFileSensor
1 source files to be analyzed
1/1 source files have been analyzed
Found 0 issue(s)

Although it indicates it's using the XmlFileSensor could it be related to the none default quality profile we applied these custom rules to not being used? However I would have thought that definition would be on the sonar project it communicates with through the HTTP REST API

Appreciate your help as I'd love to get this analysis working in SonarLint too 

Thanks

Matt  

Julien HENRY

unread,
May 4, 2017, 8:04:00 AM5/4/17
to Matt Adamson, SonarLint
Hi Matt,

SonarXML is not compatible with SonarLint. The documentation is wrong, I'll ensure it is fixed. The XmlFileSensor you see in logs is part of the SonarJava analyzer (this one is responsible to analyze some XML files related to Java, like web.xml).

++

Julien

Julien Henry | SonarSource

Developer

http://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/13b6bcea-657a-4071-a275-d5f184312289%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

matad...@googlemail.com

unread,
May 4, 2017, 9:16:25 AM5/4/17
to SonarLint, matad...@googlemail.com
Hey Julien

Thanks. Now my next question is given this is open source is it relatively easy to modify the plug in to be supported in SonarLint? If it's a few lines I could certainly help to do this as XML analysis is very important to us especially pre commit.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.

Christophe Levis

unread,
May 5, 2017, 4:56:14 AM5/5/17
to matad...@googlemail.com, SonarLint
Hi Matt,

Thanks for your offer to contribute to SonarXML.
We haven't investigated on the changes to be done to make it compatible with SonarLint. But, of course, feel free to contribute and, for that, to create a Pull Request.
I just want you to know that SonarLint won't benefit from it until a new version of SonarXML is released. And, currently, we have no plan to release on a new version of SonarXML soon.

Thanks for your understanding,
Christophe


For more options, visit https://groups.google.com/d/optout.
--

Christophe Lévis | SonarSource

Product Manager

http://sonarsource.com


Are you using SonarLint in your IDE?

matad...@googlemail.com

unread,
May 11, 2017, 6:09:24 AM5/11/17
to SonarLint, matad...@googlemail.com
Thanks Christophe, out of interest if you build the plug in yourself and make a change how would you then test it's use in eclipse?
Reply all
Reply to author
Forward
0 new messages