Skip to content

Commit

Permalink
fix: downgrade PKG-012 (non-ASCII filenames) to USAGE
Browse files Browse the repository at this point in the history
Fixes #1097
  • Loading branch information
slonopotamus authored and rdeltour committed Apr 30, 2020
1 parent 659ab76 commit f368ee5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ private void initialize()
severities.put(MessageId.PKG_009, Severity.ERROR);
severities.put(MessageId.PKG_010, Severity.WARNING);
severities.put(MessageId.PKG_011, Severity.ERROR);
severities.put(MessageId.PKG_012, Severity.WARNING);
severities.put(MessageId.PKG_012, Severity.USAGE);
severities.put(MessageId.PKG_013, Severity.ERROR);
severities.put(MessageId.PKG_014, Severity.WARNING);
severities.put(MessageId.PKG_015, Severity.FATAL);
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/adobe/epubcheck/ocf/OCFFilenameChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ public static String checkCompatiblyEscaped(final String str, Report report, EPU

private static String checkNonAsciiFilename(final String str, Report report)
{
// TODO change this from warning to a compatibility hint message level

String nonAscii = str.replaceAll("[\\p{ASCII}]", "");
if (nonAscii.length() > 0)
{
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/com/adobe/epubcheck/api/Epub30CheckTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ public void testDuplicateZipEntriesIssue265()
@Test
public void testDuplicateZipEntriesIssue265b()
{
Collections.addAll(expectedWarnings, MessageId.OPF_061, MessageId.OPF_003, MessageId.PKG_012,
MessageId.PKG_012);
Collections.addAll(expectedWarnings, MessageId.OPF_061, MessageId.OPF_003);
// non-unique entry names (after NFC normalization) should raise a warning
testValidateDocument("invalid/issue265b.epub");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ PKG-008 FATAL Unable to read file '%1$s'.
PKG-009 ERROR File name contains characters that are not allowed in OCF file names: '%1$s'.
PKG-010 WARNING Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.
PKG-011 ERROR Filename is not allowed to end with '.'.
PKG-012 WARNING File name contains the following non-ascii characters: %1$s. Consider changing the filename.
PKG-012 USAGE File name contains the following non-ascii characters: %1$s. Consider changing the filename.
PKG-013 ERROR The EPUB file includes multiple OPS renditions.
PKG-014 WARNING The EPUB contains empty directory '%1$s'.
PKG-015 FATAL Unable to read EPUB contents: %1$s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"suggestion" : null
}, {
"ID" : "PKG-012",
"severity" : "WARNING",
"severity" : "USAGE",
"message" : "File name contains the following non-ascii characters: \u0424. Consider changing the filename.",
"additionalLocations" : 0,
"locations" : [ {
Expand Down Expand Up @@ -135,8 +135,8 @@
"elapsedTime" : 78,
"nFatal" : 0,
"nError" : 4,
"nWarning" : 2,
"nUsage" : 2
"nWarning" : 1,
"nUsage" : 3
},
"publication" : {
"publisher" : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<message severity="error" subMessage="RSC-007">RSC-007, ERROR, [Referenced resource 'style.' could not be found in the EPUB.], OPS Content/Cyrillic_Ф.xhtml (6-62)</message>
<message severity="error" subMessage="RSC-007">RSC-007, ERROR, [Referenced resource '../XHTML Content/page 02.xhtml' could not be found in the EPUB.], OPS Content/Cyrillic_Ф.xhtml (13-53)</message>
<message severity="error" subMessage="PKG-009">PKG-009, ERROR, [File name contains characters that are not allowed in OCF file names: '"{","}"'.], OPS Content/page{03}.xhtml</message>
<message severity="error" subMessage="PKG-012">PKG-012, WARN, [File name contains the following non-ascii characters: Ф. Consider changing the filename.], OPS Content/Cyrillic_Ф.xhtml</message>
<message severity="info" subMessage="PKG-012">PKG-012, HINT, [File name contains the following non-ascii characters: Ф. Consider changing the filename.], OPS Content/Cyrillic_Ф.xhtml</message>
<message severity="error" subMessage="PKG-010">PKG-010, WARN, [Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.], OPS Content/Cyrillic_Ф.xhtml</message>
<message severity="error" subMessage="PKG-010">PKG-010, WARN, [Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.], OPS Content/More XHTML Content/page01.xhtml</message>
<message severity="error" subMessage="PKG-010">PKG-010, WARN, [Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.], OPS Content/content.opf</message>
Expand Down

0 comments on commit f368ee5

Please sign in to comment.