Skip to content

Commit 4e9941a

Browse files
committed
CLDR-18329 For the known cases in which there is keyword entry without tts, re-enable the check failure
1 parent efde3f3 commit 4e9941a

File tree

1 file changed

+44
-29
lines changed

1 file changed

+44
-29
lines changed

tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckAnnotations.java

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
package org.unicode.cldr.test;
22

3-
import java.util.Arrays;
3+
// import java.util.Arrays;
44
import java.util.HashMap;
5-
import java.util.HashSet;
5+
// import java.util.HashSet;
66
import java.util.List;
77
import java.util.Map;
88
import java.util.Set;
99
import java.util.regex.Matcher;
1010
import java.util.regex.Pattern;
1111
import org.unicode.cldr.test.CheckCLDR.CheckStatus.Subtype;
12+
import org.unicode.cldr.test.CheckCLDR.CheckStatus.Type;
13+
import org.unicode.cldr.util.CLDRConfig;
1214
import org.unicode.cldr.util.CLDRFile;
1315
import org.unicode.cldr.util.LocaleIDParser;
1416
import org.unicode.cldr.util.PatternCache;
@@ -21,31 +23,33 @@ public class CheckAnnotations extends CheckCLDR {
2123
// https://unicode-org.atlassian.net/browse/CLDR-18329 is fixed
2224
private static final Map<String, Set<String>> entriesLackingTts = new HashMap<>();
2325

24-
static {
25-
// locID cp= values to skip
26-
entriesLackingTts.put("ak", new HashSet<>(Arrays.asList(new String[] {"🪀"})));
27-
entriesLackingTts.put("br", new HashSet<>(Arrays.asList(new String[] {"'"})));
28-
entriesLackingTts.put("ccp", new HashSet<>(Arrays.asList(new String[] {"🥪"})));
29-
entriesLackingTts.put(
30-
"ha",
31-
new HashSet<>(Arrays.asList(new String[] {"👨‍🦯", "👨‍🦼", "👩‍🦯", "👩‍🦼"})));
32-
entriesLackingTts.put(
33-
"kab",
34-
new HashSet<>(
35-
Arrays.asList(
36-
new String[] {"⚙", "🀄", "🌤", "🎀", "💊", "💲", "🖲", "🚀"})));
37-
entriesLackingTts.put("om", null); // all entries lack tts version
38-
entriesLackingTts.put("qu", new HashSet<>(Arrays.asList(new String[] {"✒"})));
39-
entriesLackingTts.put(
40-
"sat",
41-
new HashSet<>(
42-
Arrays.asList(
43-
new String[] {
44-
"🍐", "🍑", "🍒", "🍓", "🐠", "🐡", "🐨", "🐳", "🐹", "👞",
45-
"💥", "🤽‍♂", "🥐", "🥸", "🦈"
46-
})));
47-
}
48-
;
26+
// Temporarily comment out this block so we do get errors in ST/ConsoleCheck for these cases;
27+
// either they will be fixed in ST or we will need to remove keyword entries with no tts entry;
28+
// see https://unicode-org.atlassian.net/browse/CLDR-18329.
29+
// static {
30+
// // locID cp= values to skip
31+
// entriesLackingTts.put("ak", new HashSet<>(Arrays.asList(new String[] {"🪀"})));
32+
// entriesLackingTts.put("br", new HashSet<>(Arrays.asList(new String[] {"'"})));
33+
// entriesLackingTts.put("ccp", new HashSet<>(Arrays.asList(new String[] {"🥪"})));
34+
// entriesLackingTts.put(
35+
// "ha",
36+
// new HashSet<>(Arrays.asList(new String[] {"👨‍🦯", "👨‍🦼", "👩‍🦯", "👩‍🦼"})));
37+
// entriesLackingTts.put(
38+
// "kab",
39+
// new HashSet<>(
40+
// Arrays.asList(
41+
// new String[] {"⚙", "🀄", "🌤", "🎀", "💊", "💲", "🖲", "🚀"})));
42+
// entriesLackingTts.put("om", null); // all entries lack tts version
43+
// entriesLackingTts.put("qu", new HashSet<>(Arrays.asList(new String[] {"✒"})));
44+
// entriesLackingTts.put(
45+
// "sat",
46+
// new HashSet<>(
47+
// Arrays.asList(
48+
// new String[] {
49+
// "🍐", "🍑", "🍒", "🍓", "🐠", "🐡", "🐨", "🐳", "🐹", "👞",
50+
// "💥", "🤽‍♂", "🥐", "🥸", "🦈"
51+
// })));
52+
// };
4953

5054
@Override
5155
public CheckCLDR handleCheck(
@@ -103,13 +107,24 @@ public CheckCLDR handleCheck(
103107
}
104108
}
105109
if (ttsMissing) {
110+
final CLDRConfig.Environment env = CLDRConfig.getInstance().getEnvironment();
111+
final boolean onSurveyTool =
112+
(env == CLDRConfig.Environment.PRODUCTION
113+
|| env == CLDRConfig.Environment.SMOKETEST);
114+
final Type mainType =
115+
onSurveyTool
116+
? CheckStatus.errorType // this is an error in ST
117+
: CheckStatus
118+
.warningType; // but a warning elsewhere (e.g. UNITTEST) so
119+
// we can commit
106120
result.add(
107121
new CheckStatus()
108122
.setCause(this)
109-
.setMainType(CheckStatus.errorType)
123+
.setMainType(mainType)
110124
.setSubtype(Subtype.ttsAnnotationMissing)
111125
.setMessage(
112-
"Have keywords but missing the corresponding name (tts) entry"));
126+
"Have keywords but missing the corresponding name (tts) entry; error vs warning depends on environment {0}",
127+
env));
113128
}
114129
}
115130

0 commit comments

Comments
 (0)