You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by po...@apache.org on 2020/01/27 21:41:31 UTC
[creadur-rat] branch master updated (a592b14 -> 187fc8c)
This is an automated email from the ASF dual-hosted git repository.
pottlinger pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git.
from a592b14 Merge pull request #16 from mik-laj/patch-4
new b3858cd RAT-262: Add changelog.
new 94155f1 RAT-262: Add igoring JSON file
new 257d188 RAT-262: Add JSON as example data
new 187fc8c RAT-262: Fix tests after adding JSON example data
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
apache-rat-core/.gitignore | 1 +
apache-rat-core/pom.xml | 2 ++
.../java/org/apache/rat/document/impl/guesser/BinaryGuesser.java | 4 +++-
apache-rat-core/src/test/java/org/apache/rat/ReportTest.java | 3 ++-
.../test/java/org/apache/rat/report/xml/XmlReportFactoryTest.java | 5 +++--
.../src/test/java/org/apache/rat/report/xml/XmlReportTest.java | 5 +++--
apache-rat-core/src/test/resources/elements/plain.json | 3 +++
src/changes/changes.xml | 3 +++
8 files changed, 20 insertions(+), 6 deletions(-)
create mode 100644 apache-rat-core/.gitignore
create mode 100644 apache-rat-core/src/test/resources/elements/plain.json
[creadur-rat] 01/04: RAT-262: Add changelog.
Posted by po...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pottlinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git
commit b3858cdd0de7416ec60ceda49bf270ebf90accfe
Author: Hugo Hirsch <gi...@hugo-hirsch.de>
AuthorDate: Mon Jan 27 22:18:05 2020 +0100
RAT-262: Add changelog.
---
src/changes/changes.xml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 0162a99..9296f54 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -55,6 +55,9 @@ The <action> type attribute can be add,update,fix,remove.
<body>
<release version="0.14-SNAPSHOT" date="2019-xx-xx" description="Current SNAPSHOT - to be done">
+ <action issue="RAT-262" type="fix" dev="pottlinger">
+ Treat JSON data as binary to avoid reports of missing licenses.
+ </action>
<action issue="RAT-260" type="fix" due-to="Kamil BreguĊa" dev="pottlinger">
Change to docker image when building on Travis to avoid JDK version mixup in traditional build setup.
</action>
[creadur-rat] 03/04: RAT-262: Add JSON as example data
Posted by po...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pottlinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git
commit 257d188bd877e5d4558ba0dbabf4c41323b78615
Author: Hugo Hirsch <gi...@hugo-hirsch.de>
AuthorDate: Mon Jan 27 22:40:47 2020 +0100
RAT-262: Add JSON as example data
---
apache-rat-core/src/test/resources/elements/plain.json | 3 +++
1 file changed, 3 insertions(+)
diff --git a/apache-rat-core/src/test/resources/elements/plain.json b/apache-rat-core/src/test/resources/elements/plain.json
new file mode 100644
index 0000000..e253bcc
--- /dev/null
+++ b/apache-rat-core/src/test/resources/elements/plain.json
@@ -0,0 +1,3 @@
+{
+ json: "plain"
+}
[creadur-rat] 04/04: RAT-262: Fix tests after adding JSON example
data
Posted by po...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pottlinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git
commit 187fc8cfb056e8f73375ef159d4de02534a4715a
Author: Hugo Hirsch <gi...@hugo-hirsch.de>
AuthorDate: Mon Jan 27 22:41:17 2020 +0100
RAT-262: Fix tests after adding JSON example data
---
apache-rat-core/.gitignore | 1 +
.../java/org/apache/rat/document/impl/guesser/BinaryGuesser.java | 4 +++-
apache-rat-core/src/test/java/org/apache/rat/ReportTest.java | 3 ++-
.../test/java/org/apache/rat/report/xml/XmlReportFactoryTest.java | 5 +++--
.../src/test/java/org/apache/rat/report/xml/XmlReportTest.java | 5 +++--
5 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/apache-rat-core/.gitignore b/apache-rat-core/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/apache-rat-core/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/apache-rat-core/src/main/java/org/apache/rat/document/impl/guesser/BinaryGuesser.java b/apache-rat-core/src/main/java/org/apache/rat/document/impl/guesser/BinaryGuesser.java
index daccc48..312140e 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/document/impl/guesser/BinaryGuesser.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/document/impl/guesser/BinaryGuesser.java
@@ -228,7 +228,9 @@ public class BinaryGuesser {
"RAJ", "CERT",
"KS", "ODP", "SWF",
// fonts
- "WOFF2", "WOFF", "TTF", "EOT"
+ "WOFF2", "WOFF", "TTF", "EOT",
+ // JSON structure does not allow comments/license injections in the way RAT expects it
+ "JSON"
};
private static final String[] EXE_EXTENSIONS = {
diff --git a/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java b/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
index e69a79d..444a61c 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
@@ -48,7 +48,7 @@ public class ReportTest {
private static String getElementsReports(String pElementsPath) {
return
NL + "Notes: 2" + NL +//
- "Binaries: 1" + NL +//
+ "Binaries: 2" + NL +//
"Archives: 1" + NL +//
"Standards: 7" + NL +//
"" + NL +//
@@ -88,6 +88,7 @@ public class ReportTest {
" AL " + pElementsPath + "/Xml.xml" + NL +//
" AL " + pElementsPath + "/buildr.rb" + NL +//
" A " + pElementsPath + "/dummy.jar" + NL +//
+ " B " + pElementsPath + "/plain.json" + NL +//
" !????? " + pElementsPath + "/sub/Empty.txt" + NL +//
" " + NL +//
PARAGRAPH + NL +//
diff --git a/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportFactoryTest.java b/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportFactoryTest.java
index 2b48f24..3cb1fd3 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportFactoryTest.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportFactoryTest.java
@@ -88,10 +88,11 @@ public class XmlReportFactoryTest {
"</resource>" +
"<resource name='" + elementsPath + "/buildr.rb'><type name='standard'/>" +
"</resource>" +
- "<resource name='" + elementsPath + "/dummy.jar'><type name='archive'/></resource>" +
+ "<resource name='" + elementsPath + "/dummy.jar'><type name='archive'/></resource>" +
+ "<resource name='" + elementsPath + "/plain.json'><type name='binary'/></resource>" +
"</rat-report>"));
assertTrue("Is well formed", XmlUtils.isWellFormedXml(output));
- assertEquals("Binary files", Integer.valueOf(1), statistic.getDocumentCategoryMap().get(MetaData.RAT_DOCUMENT_CATEGORY_VALUE_BINARY));
+ assertEquals("Binary files", Integer.valueOf(2), statistic.getDocumentCategoryMap().get(MetaData.RAT_DOCUMENT_CATEGORY_VALUE_BINARY));
assertEquals("Notice files", Integer.valueOf(2), statistic.getDocumentCategoryMap().get(MetaData.RAT_DOCUMENT_CATEGORY_VALUE_NOTICE));
assertEquals("Standard files", Integer.valueOf(6), statistic.getDocumentCategoryMap().get(MetaData.RAT_DOCUMENT_CATEGORY_VALUE_STANDARD));
assertEquals("Archives", Integer.valueOf(1), statistic.getDocumentCategoryMap().get(MetaData.RAT_DOCUMENT_CATEGORY_VALUE_ARCHIVE));
diff --git a/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java b/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java
index 3d6f597..ef23042 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java
@@ -86,7 +86,7 @@ public class XmlReportTest {
assertTrue("Preamble and document element are OK",
output.startsWith("<?xml version='1.0'?>" +
"<rat-report timestamp="));
- assertTrue("Part after timestamp attribute is OK",
+ assertTrue(output+"Part after timestamp attribute is OK",
output.endsWith(">" +
"<resource name='" + elementsPath + "/Image.png'><type name='binary'/></resource>" +
"<resource name='" + elementsPath + "/LICENSE'><type name='notice'/></resource>" +
@@ -208,7 +208,8 @@ public class XmlReportTest {
"end\n" +
"\n" +
"</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/></resource>" +
- "<resource name='" + elementsPath + "/dummy.jar'><type name='archive'/></resource>" +
+ "<resource name='" + elementsPath + "/dummy.jar'><type name='archive'/></resource>" +
+ "<resource name='" + elementsPath + "/plain.json'><type name='binary'/></resource>" +
"<resource name='" + elementsPath + "/sub/Empty.txt'><header-sample>\n</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/></resource>" +
"</rat-report>"));
assertTrue("Is well formed", XmlUtils.isWellFormedXml(output));
[creadur-rat] 02/04: RAT-262: Add igoring JSON file
Posted by po...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pottlinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git
commit 94155f10465bcb7c006eae485c5661d8bf97bcbb
Author: Hugo Hirsch <gi...@hugo-hirsch.de>
AuthorDate: Mon Jan 27 22:40:06 2020 +0100
RAT-262: Add igoring JSON file
As we are running with older versions of RAT
---
apache-rat-core/pom.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/apache-rat-core/pom.xml b/apache-rat-core/pom.xml
index 1031248..5505672 100644
--- a/apache-rat-core/pom.xml
+++ b/apache-rat-core/pom.xml
@@ -67,6 +67,8 @@
<exclude>src/test/resources/binaries/Image-png.not</exclude>
<!-- These files have a valid license header that was not recognised by older rat versions -->
<exclude>src/test/resources/elements/TextHttps.txt</exclude>
+ <!-- Remove after using RAT 0.14 for dog-fooding ..... older versions do not ignore JSON -->
+ <exclude>src/test/resources/elements/plain.json</exclude>
</excludes>
</configuration>
</plugin>