Skip to content

Commit

Permalink
CLDR-17736 Suppress width errors during Build phase
Browse files Browse the repository at this point in the history
  • Loading branch information
macchiati committed Jun 17, 2024
1 parent d53cd8d commit efc79c6
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public CheckCLDR handleCheck(
CheckStatus item =
new CheckStatus()
.setCause(this)
.setMainType(CheckStatus.errorType)
.setMainType(errorOrIfBuildWarning())
.setSubtype(Subtype.abbreviatedDateFieldTooWide)
.setMessage(
"Abbreviated value \"{0}\" can't be longer than the corresponding wide value \"{1}\"",
Expand Down Expand Up @@ -468,7 +468,7 @@ && isTooMuchWiderThan(value, abbrValue)
CheckStatus item =
new CheckStatus()
.setCause(this)
.setMainType(CheckStatus.errorType)
.setMainType(errorOrIfBuildWarning())
.setSubtype(Subtype.shortDateFieldInconsistentLength)
.setMessage(message, value, compareValue);
result.add(item);
Expand All @@ -481,7 +481,7 @@ && isTooMuchWiderThan(value, abbrValue)
CheckStatus item =
new CheckStatus()
.setCause(this)
.setMainType(CheckStatus.errorType)
.setMainType(errorOrIfBuildWarning())
.setSubtype(Subtype.narrowDateFieldTooWide)
.setMessage(
"Narrow value \"{0}\" can't be longer than the corresponding abbreviated value \"{1}\"",
Expand All @@ -496,7 +496,7 @@ && isTooMuchWiderThan(value, abbrValue)
CheckStatus item =
new CheckStatus()
.setCause(this)
.setMainType(CheckStatus.errorType)
.setMainType(errorOrIfBuildWarning())
.setSubtype(Subtype.abbreviatedDateFieldTooWide)
.setMessage(
"Abbreviated value \"{0}\" can't be longer than the corresponding wide value \"{1}\"",
Expand All @@ -510,7 +510,7 @@ && isTooMuchWiderThan(value, abbrValue)
result.add(
new CheckStatus()
.setCause(this)
.setMainType(CheckStatus.errorType)
.setMainType(errorOrIfBuildWarning())
.setSubtype(Subtype.illegalDatePattern)
.setMessage(failure));
}
Expand Down Expand Up @@ -729,6 +729,10 @@ && isTooMuchWiderThan(value, abbrValue)
return this;
}

public org.unicode.cldr.test.CheckCLDR.CheckStatus.Type errorOrIfBuildWarning() {
return getPhase() != Phase.BUILD ? CheckStatus.errorType : CheckStatus.warningType;
}

private boolean isTooMuchWiderThan(String shortString, String longString) {
// We all 1/3 the width of the reference character as a "fudge factor" in determining the
// allowable width
Expand Down

0 comments on commit efc79c6

Please sign in to comment.