Automated [] rollback of changelist
*** Reason for rollback ***
Breaking youtube.primary.
[]
*** Original change description ***
Drop some files from the foreach whitelist
***
@@ -461,6 +461,8 @@ public class SoyFileParser {
"foreach loops are no longer supported, please switch to the for loop."
, StyleAllowance.NO_CAPS);
+ private static final ImmutableList<String> FOREACH_WHITELISTED_PATHS = ImmutableList.of(
+ );
private static final ImmutableSet<String> FOREACH_WHITELISTED_EXACT_PATHS = ImmutableSet.of(
);
@@ -2713,7 +2715,16 @@ private ForNode ForStmt() :
)
{
if (tagBegin.kind == CMD_BEGIN_FOREACH) {
- if (FOREACH_WHITELISTED_EXACT_PATHS.contains(filePath)) {
+ boolean isWhitelisted = FOREACH_WHITELISTED_EXACT_PATHS.contains(filePath);
+ if (!isWhitelisted) {
+ for (String whitelisted : FOREACH_WHITELISTED_PATHS) {
+ if (filePath.contains(whitelisted)) {
+ isWhitelisted = true;
+ break;
+ }
+ }
+ }
+ if (isWhitelisted) {
errorReporter.warn(createSrcLoc(tagBegin), FOREACH_IS_DISABLED);
} else {
errorReporter.report(createSrcLoc(tagBegin), FOREACH_IS_DISABLED);
