From a3d6bc104535265ab04a7683b22388ec6e1b3e1d Mon Sep 17 00:00:00 2001 From: Philippe Perrin Date: Tue, 10 Jan 2023 09:07:17 +0100 Subject: [PATCH] SONAR-17836 Deactivate common rules for the "Secrets" language --- .../server/rule/CommonRuleDefinitionsImpl.java | 14 +++++++++++++- .../server/rule/CommonRuleDefinitionsImplTest.java | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/CommonRuleDefinitionsImpl.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/CommonRuleDefinitionsImpl.java index f2807079b77..708dcf15109 100644 --- a/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/CommonRuleDefinitionsImpl.java +++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/CommonRuleDefinitionsImpl.java @@ -39,7 +39,19 @@ import static org.sonar.server.rule.CommonRuleKeys.commonRepositoryForLang; // It replaces the common-rules that are still embedded within plugins. public class CommonRuleDefinitionsImpl implements CommonRuleDefinitions { - private static final List LANGUAGES_TO_SKIP = List.of("terraform", "cloudformation", "kubernetes", "docker", "web", "css", "xml", "yaml", "json", "jsp", "text"); + private static final List LANGUAGES_TO_SKIP = List.of( + "terraform", + "cloudformation", + "kubernetes", + "docker", + "web", + "css", + "xml", + "yaml", + "json", + "jsp", + "text", + "secrets"); private static final String MINUTES_10 = "10min"; private final Languages languages; diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/CommonRuleDefinitionsImplTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/CommonRuleDefinitionsImplTest.java index acdf03aeff3..5e2f77560f2 100644 --- a/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/CommonRuleDefinitionsImplTest.java +++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/CommonRuleDefinitionsImplTest.java @@ -65,7 +65,8 @@ public class CommonRuleDefinitionsImplTest { createLanguage("yaml"), createLanguage("json"), createLanguage("jsp"), - createLanguage("text") + createLanguage("text"), + createLanguage("secrets") ); } -- 2.39.5