Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Commit

Permalink
Suppress warning messages for whitelisted properties.
Browse files Browse the repository at this point in the history
Tweak the CSS compiler to not complain about recognized properties with
warnings if they are whitelisted with
--allowed_unrecognized_properties. Property warnings are already
disabled with the --allow_unrecognized_properties flag (see
com.google.common.css.compiler.passes.PassRunner:177) so it makes sense
to overload this flag to also whitelist flags that are *technically*
recognized, but not supported.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133199104
MOE_MIGRATED_REVID=133703695
  • Loading branch information
iflan committed Sep 21, 2016
1 parent ca18477 commit b9852d2
Showing 1 changed file with 12 additions and 10 deletions.
Expand Up @@ -76,17 +76,19 @@ public boolean enterDeclaration(CssDeclarationNode declarationNode) {
property = Property.byName(propertyName);
}

if (!property.isRecognizedProperty() &&
!allowedUnrecognizedProperties.contains(property.getName())) {
reportError(String.format("%s is an unrecognized property",
property.getName()), propertyNode);
} else if (property.hasWarning()) {
errorManager.reportWarning(new GssError(
String.format(
"WARNING for use of CSS property %s: %s\n",
property.getName(), property.getWarning()),
propertyNode.getSourceCodeLocation()));
if (!allowedUnrecognizedProperties.contains(property.getName())) {
if (!property.isRecognizedProperty()) {
reportError(String.format("%s is an unrecognized property",
property.getName()), propertyNode);
} else if (property.hasWarning()) {
errorManager.reportWarning(new GssError(
String.format(
"WARNING for use of CSS property %s: %s\n",
property.getName(), property.getWarning()),
propertyNode.getSourceCodeLocation()));
}
}

return true;
}

Expand Down

0 comments on commit b9852d2

Please sign in to comment.