diff options
| author | Amaury Levé | 2018-06-22 16:22:04 +0200 |
|---|---|---|
| committer | GitHub | 2018-06-22 16:22:04 +0200 |
| commit | 7385260825c79419a920bdf835e925cef916b404 (patch) | |
| tree | 0d50a28fc9e2eb0de3169c602651617c6d2a8c13 /sonar-css-plugin/src/main/java/org | |
| parent | 08d6560282dcd46710d7ad2db4ab8a4bb969e116 (diff) | |
| download | sonar-css-7385260825c79419a920bdf835e925cef916b404.tar.bz2 | |
Rule S4656: Properties should not be duplicated (#63)
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/DeclarationBlockNoDuplicateProperties.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 fe625d5..92d59aa 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 @@ -24,6 +24,7 @@ import org.sonar.api.batch.rule.Checks; import org.sonar.api.rule.RuleKey; 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.KeyframeDeclarationNoImportant; import org.sonar.css.plugin.rules.NoEmptySource; import org.sonar.css.plugin.rules.ColorNoInvalidHex; @@ -57,6 +58,7 @@ public class CssRules { return Collections.unmodifiableList(Arrays.asList( ColorNoInvalidHex.class, CommentNoEmpty.class, + DeclarationBlockNoDuplicateProperties.class, KeyframeDeclarationNoImportant.class, NoEmptySource.class, StringNoNewline.class, diff --git a/sonar-css-plugin/src/main/java/org/sonar/css/plugin/rules/DeclarationBlockNoDuplicateProperties.java b/sonar-css-plugin/src/main/java/org/sonar/css/plugin/rules/DeclarationBlockNoDuplicateProperties.java new file mode 100644 index 0000000..75382de --- /dev/null +++ b/sonar-css-plugin/src/main/java/org/sonar/css/plugin/rules/DeclarationBlockNoDuplicateProperties.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 = "S4656") +public class DeclarationBlockNoDuplicateProperties implements CssRule { + + @Override + public String stylelintKey() { + return "declaration-block-no-duplicate-properties"; + } +} |
