forked from SonarSource/sonar-xml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a plugin setting to enable an administrator to define a list of…
… XML file patterns that should not be included in the lines of code metric. An example case is where we generate an xml report such as "effective-pom.xml" or "classloader-collisions.xml" prior to scanning the project with Sonarqube. In those cases we need Sonar to see the files so that our custom XML rules will raise issues based on their content. They do not represent lines of code for the project though so we need a way to prevent their content from being included in the project's LOC metric. This change provides that capability.
- Loading branch information
Showing
5 changed files
with
133 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
sonar-xml-plugin/src/test/resources/xmlsensor/some-configuration-is-code-file.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- could be a Spring, Maven, or other config file. This file is used to validate that lines of code are counted for this kind of XML resource. --> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>test</groupId> | ||
<artifactId>test</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>test</name> | ||
<build> | ||
<sourceDirectory>src/main/code</sourceDirectory> | ||
</build> | ||
<properties> | ||
<sonar.xml.sourceDirectory>src</sonar.xml.sourceDirectory> | ||
<sonar.language>xml</sonar.language> | ||
<sonar.dynamicAnalysis>false</sonar.dynamicAnalysis> | ||
<sonar.xml.fileExtensions>xml</sonar.xml.fileExtensions> | ||
<sonar.xml.schemas>xhtml1-strict</sonar.xml.schemas> | ||
</properties> | ||
</project> |
7 changes: 7 additions & 0 deletions
7
sonar-xml-plugin/src/test/resources/xmlsensor/some-data-file.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<content> | ||
<item-list> | ||
<item>1</item> | ||
<item>2</item> | ||
<item>3</item> | ||
</item-list> | ||
</content> |