2 * SonarQube, open source software quality management tool.
3 * Copyright (C) 2008-2013 SonarSource
4 * mailto:contact AT sonarsource DOT com
6 * SonarQube is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
11 * SonarQube is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 package org.sonar.plugins.core.issue.ignore;
23 import org.sonar.api.PropertyType;
25 import org.sonar.api.config.PropertyFieldDefinition;
26 import org.sonar.api.resources.Qualifiers;
27 import org.sonar.api.CoreProperties;
28 import com.google.common.collect.ImmutableList;
29 import org.sonar.api.config.PropertyDefinition;
31 import java.util.List;
33 public final class IgnoreIssuesConfiguration {
35 private IgnoreIssuesConfiguration() {}
37 static final int LARGE_SIZE = 20;
38 static final int SMALL_SIZE = 10;
40 public static List<PropertyDefinition> getPropertyDefinitions() {
41 return ImmutableList.of(
42 PropertyDefinition.builder(Constants.PATTERNS_MULTICRITERIA_KEY)
43 .category(CoreProperties.CATEGORY_EXCLUSIONS)
44 .subCategory(Constants.SUB_CATEGORY_IGNORE_ISSUES)
45 .name("Resource Key Pattern")
46 .description("Patterns used to identify which violations to switch off.<br/>" +
47 "More information on the <a href=\"http://docs.codehaus.org/display/SONAR/Project+Administration#ProjectAdministration-IgnoringIssues\">Project Administration page</a>.<br/>")
48 .onQualifiers(Qualifiers.PROJECT)
50 PropertyFieldDefinition.build(Constants.RESOURCE_KEY)
51 .name("Resource Key Pattern")
52 .description("Pattern used to match resources which should be ignored")
53 .type(PropertyType.STRING)
54 .indicativeSize(LARGE_SIZE)
56 PropertyFieldDefinition.build(Constants.RULE_KEY)
57 .name("Rule Key Pattern")
58 .description("Pattern used to match rules which should be ignored")
59 .type(PropertyType.STRING)
60 .indicativeSize(LARGE_SIZE)
62 PropertyFieldDefinition.build(Constants.LINE_RANGE_KEY)
64 .description("Range of lines that should be ignored.")
65 .type(PropertyType.STRING)
66 .indicativeSize(SMALL_SIZE)
69 PropertyDefinition.builder(Constants.PATTERNS_BLOCK_KEY)
70 .category(CoreProperties.CATEGORY_EXCLUSIONS)
71 .subCategory(Constants.SUB_CATEGORY_IGNORE_ISSUES)
72 .name("Block exclusion patterns")
73 .description("Patterns used to identify blocks in which violations are switched off.<br/>" +
74 "More information on the <a href=\"http://docs.codehaus.org/display/SONAR/Project+Administration#ProjectAdministration-IgnoringIssues\">Project Administration page</a>.<br/>")
75 .onQualifiers(Qualifiers.PROJECT)
77 PropertyFieldDefinition.build(Constants.BEGIN_BLOCK_REGEXP)
78 .name("Regular expression for start of block")
79 .description("If this regular expression is found in a resource, then following lines are ignored until end of block.")
80 .type(PropertyType.STRING)
81 .indicativeSize(LARGE_SIZE)
83 PropertyFieldDefinition.build(Constants.END_BLOCK_REGEXP)
84 .name("Regular expression for end of block")
85 .description("If specified, this regular expression is used to determine the end of code blocks to ignore. If not, then block ends at the end of file.")
86 .type(PropertyType.STRING)
87 .indicativeSize(LARGE_SIZE)
90 PropertyDefinition.builder(Constants.PATTERNS_ALLFILE_KEY)
91 .category(CoreProperties.CATEGORY_EXCLUSIONS)
92 .subCategory(Constants.SUB_CATEGORY_IGNORE_ISSUES)
93 .name("File exclusion patterns")
94 .description("Patterns used to identify files in which violations are switched off.<br/>" +
95 "More information on the <a href=\"http://docs.codehaus.org/display/SONAR/Project+Administration#ProjectAdministration-IgnoringIssues\">Project Administration page</a>.<br/>")
96 .onQualifiers(Qualifiers.PROJECT)
98 PropertyFieldDefinition.build(Constants.FILE_REGEXP)
99 .name("Regular expression")
100 .description("If this regular expression is found in a resource, then following lines are ignored.")
101 .type(PropertyType.STRING)
102 .indicativeSize(LARGE_SIZE)