From 7a2daa058f3da99a224a2c874e554f88d2ad8104 Mon Sep 17 00:00:00 2001 From: Amaury Levé Date: Thu, 21 Jun 2018 15:53:16 +0200 Subject: Rule S4663: Comments should not be empty (#51) --- .../main/java/org/sonar/css/plugin/CssRules.java | 4 ++- .../org/sonar/css/plugin/rules/CommentNoEmpty.java | 31 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 sonar-css-plugin/src/main/java/org/sonar/css/plugin/rules/CommentNoEmpty.java (limited to 'sonar-css-plugin/src/main/java/org/sonar/css') 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 1dac08c..5a4be0c 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 @@ -23,6 +23,7 @@ import org.sonar.api.batch.rule.CheckFactory; import org.sonar.api.batch.rule.Checks; import org.sonar.api.rule.RuleKey; 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.UnitNoUnknown; @@ -52,7 +53,8 @@ public class CssRules { public static List getRuleClasses() { return Collections.unmodifiableList(Arrays.asList( ColorNoInvalidHex.class, - UnitNoUnknown.class + UnitNoUnknown.class, + CommentNoEmpty.class )); } diff --git a/sonar-css-plugin/src/main/java/org/sonar/css/plugin/rules/CommentNoEmpty.java b/sonar-css-plugin/src/main/java/org/sonar/css/plugin/rules/CommentNoEmpty.java new file mode 100644 index 0000000..547b5db --- /dev/null +++ b/sonar-css-plugin/src/main/java/org/sonar/css/plugin/rules/CommentNoEmpty.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 = "S4663") +public class CommentNoEmpty implements CssRule { + + @Override + public String stylelintKey() { + return "comment-no-empty"; + } +} -- cgit v1.2.3