diff options
| author | Amaury Levé | 2018-06-25 13:44:45 +0200 | 
|---|---|---|
| committer | Elena Vilchik | 2018-06-26 11:16:30 +0200 | 
| commit | e78f845d7f25952cd5703296455e4e4825d9ec8e (patch) | |
| tree | 967d611823663b62f0feb814ca167de482961014 /sonar-css-plugin/src/main/java/org | |
| parent | 12d9eddb516233de212434b329a35e114c387c5c (diff) | |
| download | sonar-css-e78f845d7f25952cd5703296455e4e4825d9ec8e.tar.bz2 | |
Rule S4657: Shorthand properties that override related longhand properties should be avoided
Diffstat (limited to 'sonar-css-plugin/src/main/java/org')
| -rw-r--r-- | sonar-css-plugin/src/main/java/org/sonar/css/plugin/CssRules.java | 2 | ||||
| -rw-r--r-- | sonar-css-plugin/src/main/java/org/sonar/css/plugin/rules/DeclarationBlockNoShorthandPropertyOverrides.java | 31 | 
2 files changed, 33 insertions, 0 deletions
diff --git a/sonar-css-plugin/src/main/java/org/sonar/css/plugin/CssRules.java b/sonar-css-plugin/src/main/java/org/sonar/css/plugin/CssRules.java index 87ff17b..479adb5 100644 --- a/sonar-css-plugin/src/main/java/org/sonar/css/plugin/CssRules.java +++ b/sonar-css-plugin/src/main/java/org/sonar/css/plugin/CssRules.java @@ -34,6 +34,7 @@ import org.sonar.css.plugin.rules.ColorNoInvalidHex;  import org.sonar.css.plugin.rules.CommentNoEmpty;  import org.sonar.css.plugin.rules.CssRule;  import org.sonar.css.plugin.rules.DeclarationBlockNoDuplicateProperties; +import org.sonar.css.plugin.rules.DeclarationBlockNoShorthandPropertyOverrides;  import org.sonar.css.plugin.rules.FontFamilyNoDuplicateNames;  import org.sonar.css.plugin.rules.FontFamilyNoMissingGenericFamilyKeyword;  import org.sonar.css.plugin.rules.KeyframeDeclarationNoImportant; @@ -66,6 +67,7 @@ public class CssRules {        ColorNoInvalidHex.class,        CommentNoEmpty.class,        DeclarationBlockNoDuplicateProperties.class, +      DeclarationBlockNoShorthandPropertyOverrides.class,        FontFamilyNoDuplicateNames.class,        FontFamilyNoMissingGenericFamilyKeyword.class,        KeyframeDeclarationNoImportant.class, diff --git a/sonar-css-plugin/src/main/java/org/sonar/css/plugin/rules/DeclarationBlockNoShorthandPropertyOverrides.java b/sonar-css-plugin/src/main/java/org/sonar/css/plugin/rules/DeclarationBlockNoShorthandPropertyOverrides.java new file mode 100644 index 0000000..4520129 --- /dev/null +++ b/sonar-css-plugin/src/main/java/org/sonar/css/plugin/rules/DeclarationBlockNoShorthandPropertyOverrides.java @@ -0,0 +1,31 @@ +/* + * SonarCSS + * Copyright (C) 2018-2018 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. + */ +package org.sonar.css.plugin.rules; + +import org.sonar.check.Rule; + +@Rule(key = "S4657") +public class DeclarationBlockNoShorthandPropertyOverrides implements CssRule { + +  @Override +  public String stylelintKey() { +    return "declaration-block-no-shorthand-property-overrides"; +  } +}  | 
