forked from phoedos/pmd
Merge pull request #4799 from adangel:issue-3917-rule-package
[core] Consolidate n.s.pmd.lang.rule package #4799
This commit is contained in:
@ -73,19 +73,19 @@ require_relative 'jdoc_namespace_tag'
|
||||
# * a (args) -> adds the simple name of the argument types for method references, noop for other references
|
||||
# * {% jdoc !a!core::Rule#setName(java.lang.String) %} -> [`setName(String)`](...)
|
||||
# * q (qualify) -> prefix with the fqcn of the class, noop for package references
|
||||
# * {% jdoc !q!core::Rule %} -> [`net.sourceforge.pmd.Rule`](...)
|
||||
# * {% jdoc !q!core::Rule#setName(java.lang.String) %} -> [`net.sourceforge.pmd.Rule#setName`](...)
|
||||
# * {% jdoc !q!core::rule.Rule %} -> [`net.sourceforge.pmd.lang.rule.Rule`](...)
|
||||
# * {% jdoc !q!core::rule.Rule#setName(java.lang.String) %} -> [`net.sourceforge.pmd.lang.rule.Rule#setName`](...)
|
||||
# * c (class) -> prefix the class name for member references, noop for type and package references, or if "qualify" is specified
|
||||
# * {% jdoc !c!core::Rule#setName(java.lang.String) %} -> [`Rule#setName`](...)
|
||||
# * Empty options ("!!") - > shorthand to a commonly relevant option
|
||||
# * For field or method references, "!!" is the "c" option
|
||||
# * {% jdoc !!core::Rule#setName(java.lang.String) %} -> [`Rule#setName`](...)
|
||||
# * For type references, "!!" is the "q" option
|
||||
# * {% jdoc !!core::Rule %} -> [`net.sourceforge.pmd.Rule`](...)
|
||||
# * {% jdoc !!core::rule.Rule %} -> [`net.sourceforge.pmd.lang.rule.Rule`](...)
|
||||
# * For package references, "!!" is a noop, they're always fully qualified
|
||||
# * Several options may be used at once, though this is only useful for method references:
|
||||
# * {% jdoc !ac!core::Rule#setName(java.lang.String) %} -> [`Rule#setName(String)`](...)
|
||||
# * {% jdoc !aq!core::Rule#setName(java.lang.String) %} -> [`net.sourceforge.pmd.Rule#setName(String)`](...)
|
||||
# * {% jdoc !aq!core::rule.Rule#setName(java.lang.String) %} -> [`net.sourceforge.pmd.lang.rule.Rule#setName(String)`](...)
|
||||
#
|
||||
# * DO NOT:
|
||||
# - Include spaces in any part of the reference
|
||||
|
@ -172,6 +172,7 @@ The rules have been moved into categories with PMD 6.
|
||||
* [#4723](https://github.com/pmd/pmd/issues/4723): \[cli] Launch fails for "bash pmd"
|
||||
* core
|
||||
* [#1027](https://github.com/pmd/pmd/issues/1027): \[core] Apply the new PropertyDescriptor<Pattern> type where applicable
|
||||
* [#3917](https://github.com/pmd/pmd/issues/3917): \[core] Consolidate `n.s.pmd.lang.rule` package
|
||||
* [#4065](https://github.com/pmd/pmd/issues/4065): \[core] Rename TokenMgrError to LexException, Tokenizer to CpdLexer
|
||||
* [#4312](https://github.com/pmd/pmd/issues/4312): \[core] Remove unnecessary property `color` and system property `pmd.color` in `TextColorRenderer`
|
||||
* [#4313](https://github.com/pmd/pmd/issues/4313): \[core] Remove support for <lang>-<ruleset> hyphen notation for ruleset references
|
||||
@ -233,6 +234,31 @@ The rules have been moved into categories with PMD 6.
|
||||
See [General AST Changes to avoid @Image]({{ baseurl }}pmd_userdocs_migrating_to_pmd7.html#general-ast-changes-to-avoid-image)
|
||||
in the migration guide for details.
|
||||
|
||||
**Moved classes/consolidated packages**
|
||||
|
||||
* pmd-core
|
||||
* Many types have been moved from the base package `net.sourceforge.pmd` into subpackage {% jdoc_package core::lang.rule %}
|
||||
* {%jdoc core::lang.rule.Rule %}
|
||||
* {%jdoc core::lang.rule.RulePriority %}
|
||||
* {%jdoc core::lang.rule.RuleSet %}
|
||||
* {%jdoc core::lang.rule.RuleSetFactory %}
|
||||
* {%jdoc core::lang.rule.RuleSetFactoryCompatibility %}
|
||||
* {%jdoc core::lang.rule.RuleSetLoader %}
|
||||
* {%jdoc core::lang.rule.RuleSetLoadException %}
|
||||
* {%jdoc core::lang.rule.RuleSetWriter %}
|
||||
|
||||
**Internalized classes**
|
||||
|
||||
These were marked as `@InternalApi` previously.
|
||||
|
||||
* pmd-core
|
||||
* `RuleFactory`: moved from `net.sourceforge.pmd.rules` into subpackage `lang.rule`.
|
||||
It has now been hidden completely from public API.
|
||||
* Many types have been moved from the base package `net.sourceforge.pmd` into subpackage `lang.rule.internal`.
|
||||
* `RuleSetReference`
|
||||
* `RuleSetReferenceId`
|
||||
* `RuleSets`
|
||||
|
||||
**Removed classes and methods (previously deprecated)**
|
||||
|
||||
The following previously deprecated classes have been removed:
|
||||
@ -703,6 +729,7 @@ See also [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7.
|
||||
* [#3815](https://github.com/pmd/pmd/issues/3815): \[core] Update Saxon HE to 10.7
|
||||
* [#3893](https://github.com/pmd/pmd/pull/3893): \[core] Text documents
|
||||
* [#3902](https://github.com/pmd/pmd/issues/3902): \[core] Violation decorators
|
||||
* [#3917](https://github.com/pmd/pmd/issues/3917): \[core] Consolidate `n.s.pmd.lang.rule` package
|
||||
* [#3918](https://github.com/pmd/pmd/issues/3918): \[core] Make LanguageRegistry non static
|
||||
* [#3919](https://github.com/pmd/pmd/issues/3919): \[core] Merge CPD and PMD language
|
||||
* [#3922](https://github.com/pmd/pmd/pull/3922): \[core] Better error reporting for the ruleset parser
|
||||
|
@ -17,9 +17,9 @@ import org.apache.tools.ant.types.Path;
|
||||
import org.apache.tools.ant.types.Reference;
|
||||
import org.apache.tools.ant.types.Resource;
|
||||
|
||||
import net.sourceforge.pmd.RulePriority;
|
||||
import net.sourceforge.pmd.annotation.InternalApi;
|
||||
import net.sourceforge.pmd.ant.internal.PMDTaskImpl;
|
||||
import net.sourceforge.pmd.lang.rule.RulePriority;
|
||||
|
||||
/**
|
||||
* PMD Ant task. Setters of this class are interpreted by Ant as properties
|
||||
|
@ -23,8 +23,6 @@ import org.slf4j.event.Level;
|
||||
|
||||
import net.sourceforge.pmd.PMDConfiguration;
|
||||
import net.sourceforge.pmd.PmdAnalysis;
|
||||
import net.sourceforge.pmd.RulePriority;
|
||||
import net.sourceforge.pmd.RuleSetLoader;
|
||||
import net.sourceforge.pmd.ant.Formatter;
|
||||
import net.sourceforge.pmd.ant.PMDTask;
|
||||
import net.sourceforge.pmd.ant.SourceLanguage;
|
||||
@ -35,6 +33,8 @@ import net.sourceforge.pmd.lang.Language;
|
||||
import net.sourceforge.pmd.lang.LanguageRegistry;
|
||||
import net.sourceforge.pmd.lang.LanguageVersion;
|
||||
import net.sourceforge.pmd.lang.document.TextFile;
|
||||
import net.sourceforge.pmd.lang.rule.RulePriority;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSetLoader;
|
||||
import net.sourceforge.pmd.reporting.FileAnalysisListener;
|
||||
import net.sourceforge.pmd.reporting.GlobalAnalysisListener;
|
||||
import net.sourceforge.pmd.reporting.ReportStats;
|
||||
|
@ -15,7 +15,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import net.sourceforge.pmd.Report;
|
||||
import net.sourceforge.pmd.Report.SuppressedViolation;
|
||||
import net.sourceforge.pmd.Rule;
|
||||
import net.sourceforge.pmd.RuleViolation;
|
||||
import net.sourceforge.pmd.ViolationSuppressor;
|
||||
import net.sourceforge.pmd.lang.apex.ast.ASTAnnotation;
|
||||
@ -30,6 +29,7 @@ import net.sourceforge.pmd.lang.apex.ast.ASTUserEnum;
|
||||
import net.sourceforge.pmd.lang.apex.ast.ASTVariableDeclarationStatements;
|
||||
import net.sourceforge.pmd.lang.apex.ast.ApexNode;
|
||||
import net.sourceforge.pmd.lang.ast.Node;
|
||||
import net.sourceforge.pmd.lang.rule.Rule;
|
||||
|
||||
final class ApexViolationSuppressors {
|
||||
|
||||
|
@ -9,9 +9,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.AbstractRuleSetFactoryTest;
|
||||
import net.sourceforge.pmd.RuleSet;
|
||||
import net.sourceforge.pmd.RuleSetLoader;
|
||||
import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSet;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSetLoader;
|
||||
|
||||
import com.github.stefanbirkner.systemlambda.SystemLambda;
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
package net.sourceforge.pmd.lang.apex;
|
||||
|
||||
import net.sourceforge.pmd.AbstractRuleSetFactoryTest;
|
||||
import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest;
|
||||
|
||||
class RuleSetFactoryTest extends AbstractRuleSetFactoryTest {
|
||||
// no additional tests yet
|
||||
|
@ -16,14 +16,14 @@ import org.junit.jupiter.api.io.TempDir;
|
||||
import net.sourceforge.pmd.PMDConfiguration;
|
||||
import net.sourceforge.pmd.PmdAnalysis;
|
||||
import net.sourceforge.pmd.Report;
|
||||
import net.sourceforge.pmd.Rule;
|
||||
import net.sourceforge.pmd.RuleSet;
|
||||
import net.sourceforge.pmd.RuleSetLoader;
|
||||
import net.sourceforge.pmd.RuleViolation;
|
||||
import net.sourceforge.pmd.lang.Language;
|
||||
import net.sourceforge.pmd.lang.LanguageVersion;
|
||||
import net.sourceforge.pmd.lang.apex.ApexLanguageModule;
|
||||
import net.sourceforge.pmd.lang.apex.ApexLanguageProperties;
|
||||
import net.sourceforge.pmd.lang.rule.Rule;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSet;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSetLoader;
|
||||
import net.sourceforge.pmd.reporting.GlobalAnalysisListener;
|
||||
|
||||
import com.nawforce.pkgforce.path.PathFactory;
|
||||
|
@ -20,7 +20,6 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import net.sourceforge.pmd.PMDConfiguration;
|
||||
import net.sourceforge.pmd.PmdAnalysis;
|
||||
import net.sourceforge.pmd.RulePriority;
|
||||
import net.sourceforge.pmd.benchmark.TextTimingReportRenderer;
|
||||
import net.sourceforge.pmd.benchmark.TimeTracker;
|
||||
import net.sourceforge.pmd.benchmark.TimingReport;
|
||||
@ -33,6 +32,7 @@ import net.sourceforge.pmd.cli.internal.ProgressBarListener;
|
||||
import net.sourceforge.pmd.internal.LogMessages;
|
||||
import net.sourceforge.pmd.lang.Language;
|
||||
import net.sourceforge.pmd.lang.LanguageVersion;
|
||||
import net.sourceforge.pmd.lang.rule.RulePriority;
|
||||
import net.sourceforge.pmd.properties.PropertyDescriptor;
|
||||
import net.sourceforge.pmd.renderers.Renderer;
|
||||
import net.sourceforge.pmd.renderers.RendererFactory;
|
||||
|
@ -8,7 +8,7 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.pmd.RulePriority;
|
||||
import net.sourceforge.pmd.lang.rule.RulePriority;
|
||||
|
||||
import picocli.CommandLine.ITypeConverter;
|
||||
import picocli.CommandLine.TypeConversionException;
|
||||
|
@ -43,6 +43,20 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jboss.bridger</groupId>
|
||||
<artifactId>bridger</artifactId>
|
||||
<version>1.6.Final</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>weave</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>transform</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-invoker-plugin</artifactId>
|
||||
|
@ -1,4 +1,4 @@
|
||||
invoker.goals.1 = verify
|
||||
invoker.goals.1 = verify -e
|
||||
invoker.goals.2 = pmd:check -Dformat=csv
|
||||
invoker.goals.3 = pmd:check -Dformat=txt
|
||||
invoker.buildResult = failure
|
||||
|
@ -3,7 +3,10 @@
|
||||
*/
|
||||
|
||||
// This class has been taken from 7.0.0-SNAPSHOT
|
||||
// Changes: setSourceEncoding
|
||||
// Changes:
|
||||
// - setSourceEncoding
|
||||
// - setBenchmark (non-functional)
|
||||
// - getMinimumPriority
|
||||
|
||||
package net.sourceforge.pmd;
|
||||
|
||||
@ -30,6 +33,7 @@ import net.sourceforge.pmd.cache.NoopAnalysisCache;
|
||||
import net.sourceforge.pmd.internal.util.ClasspathClassLoader;
|
||||
import net.sourceforge.pmd.lang.Language;
|
||||
import net.sourceforge.pmd.lang.LanguageRegistry;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSetLoader;
|
||||
import net.sourceforge.pmd.renderers.Renderer;
|
||||
import net.sourceforge.pmd.renderers.RendererFactory;
|
||||
import net.sourceforge.pmd.util.AssertionUtil;
|
||||
@ -585,4 +589,14 @@ public class PMDConfiguration extends AbstractConfiguration {
|
||||
public void setSourceEncoding(String sourceEncoding) {
|
||||
setSourceEncoding(Charset.forName(Objects.requireNonNull(sourceEncoding)));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setBenchmark(boolean benchmark) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
// new method to be compatible with PMD 7 - RulePriority has changed package
|
||||
public net.sourceforge.pmd.lang.rule.RulePriority getMinimumPriority$$bridge() { // SUPPRESS CHECKSTYLE ignore
|
||||
return minimumPriority.asPMD7RulePriority();
|
||||
}
|
||||
}
|
||||
|
320
pmd-compat6/src/main/java/net/sourceforge/pmd/Rule.java
Normal file
320
pmd-compat6/src/main/java/net/sourceforge/pmd/Rule.java
Normal file
File diff suppressed because it is too large
Load Diff
138
pmd-compat6/src/main/java/net/sourceforge/pmd/RulePriority.java
Normal file
138
pmd-compat6/src/main/java/net/sourceforge/pmd/RulePriority.java
Normal file
@ -0,0 +1,138 @@
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
// Copy of net.sourceforge.pmd.lang.rule.RulePriority
|
||||
// Added method:
|
||||
// - asPMD7RulePriority
|
||||
|
||||
package net.sourceforge.pmd;
|
||||
|
||||
/**
|
||||
* These are the possible Rule priority values.
|
||||
*
|
||||
* For backward compatibility, priorities range in value from 1 to 5, with 5
|
||||
* being the lowest priority. This means the ordinal value of the Enum should be
|
||||
* avoided in favor of {@link RulePriority#getPriority()} and
|
||||
* {@link RulePriority#valueOf(int)}
|
||||
*
|
||||
* @see <a href="https://docs.pmd-code.org/latest/pmd_userdocs_extending_rule_guidelines.html">How
|
||||
* to define rules priority</a>
|
||||
*/
|
||||
public enum RulePriority {
|
||||
|
||||
/** High: Change absolutely required. Behavior is critically broken/buggy */
|
||||
HIGH(1, "High"),
|
||||
/**
|
||||
* Medium to high: Change highly recommended. Behavior is quite likely to be
|
||||
* broken/buggy.
|
||||
*/
|
||||
MEDIUM_HIGH(2, "Medium High"),
|
||||
/**
|
||||
* Medium: Change recommended. Behavior is confusing, perhaps buggy, and/or
|
||||
* against standards/best practices.
|
||||
*/
|
||||
MEDIUM(3, "Medium"),
|
||||
/**
|
||||
* Medium to low: Change optional. Behavior is not likely to be buggy, but
|
||||
* more just flies in the face of standards/style/good taste.
|
||||
*/
|
||||
MEDIUM_LOW(4, "Medium Low"),
|
||||
/**
|
||||
* Low: Change highly optional. Nice to have, such as a consistent naming
|
||||
* policy for package/class/fields...
|
||||
*/
|
||||
LOW(5, "Low");
|
||||
|
||||
private final int priority;
|
||||
private final String name;
|
||||
|
||||
RulePriority(int priority, String name) {
|
||||
this.priority = priority;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the priority value as a number. This is the value to be used in the
|
||||
* externalized form of a priority (e.g. in RuleSet XML).
|
||||
*
|
||||
* @return The <code>int</code> value of the priority.
|
||||
*/
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the descriptive name of this priority.
|
||||
*
|
||||
* @return The descriptive name.
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the descriptive name of the priority.
|
||||
*
|
||||
* @return descriptive name of the priority
|
||||
* @see #getName()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the priority which corresponds to the given number as returned by
|
||||
* {@link RulePriority#getPriority()}. If the number is an invalid value,
|
||||
* then {@link RulePriority#LOW} will be returned.
|
||||
*
|
||||
* @param priority
|
||||
* The numeric priority value.
|
||||
* @return The priority.
|
||||
*/
|
||||
public static RulePriority valueOf(int priority) {
|
||||
try {
|
||||
return RulePriority.values()[priority - 1];
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
return LOW;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the priority which corresponds to the given number as returned by
|
||||
* {@link RulePriority#getPriority()}. If the number is an invalid value,
|
||||
* then null will be returned.
|
||||
*
|
||||
* @param priority The numeric priority value.
|
||||
*/
|
||||
public static RulePriority valueOfNullable(int priority) {
|
||||
try {
|
||||
return RulePriority.values()[priority - 1];
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the priority which corresponds to the given number as returned by
|
||||
* {@link RulePriority#getPriority()}. If the number is an invalid value,
|
||||
* then null will be returned.
|
||||
*
|
||||
* @param priority The numeric priority value.
|
||||
*/
|
||||
public static RulePriority valueOfNullable(String priority) {
|
||||
try {
|
||||
int integer = Integer.parseInt(priority);
|
||||
return RulePriority.values()[integer - 1];
|
||||
} catch (ArrayIndexOutOfBoundsException | NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// ---- compatibility extensions
|
||||
|
||||
public net.sourceforge.pmd.lang.rule.RulePriority asPMD7RulePriority() {
|
||||
return net.sourceforge.pmd.lang.rule.RulePriority.valueOf(name());
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
public class RuleSetLoadException extends net.sourceforge.pmd.lang.rule.RuleSetLoadException {
|
||||
public RuleSetLoadException(RuleSetReferenceId rsetId, @NonNull Throwable cause) {
|
||||
super(rsetId, cause);
|
||||
}
|
||||
|
||||
public RuleSetLoadException(RuleSetReferenceId rsetId, String message) {
|
||||
super(rsetId, message);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd;
|
||||
|
||||
public class RuleSetReferenceId extends net.sourceforge.pmd.lang.rule.internal.RuleSetReferenceId {
|
||||
public RuleSetReferenceId(String id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
public RuleSetReferenceId(String id, RuleSetReferenceId externalRuleSetReferenceId) {
|
||||
super(id, externalRuleSetReferenceId);
|
||||
}
|
||||
}
|
@ -3,7 +3,9 @@
|
||||
*/
|
||||
|
||||
// This class has been taken from 7.0.0-SNAPSHOT
|
||||
// Changes: getFilename
|
||||
// Changes:
|
||||
// - getFilename
|
||||
// - getRule returns n.s.pmd.rule.Rule or the old n.s.pmd.Rule
|
||||
|
||||
package net.sourceforge.pmd;
|
||||
|
||||
@ -68,7 +70,7 @@ public interface RuleViolation {
|
||||
*
|
||||
* @return The identifying Rule.
|
||||
*/
|
||||
Rule getRule();
|
||||
net.sourceforge.pmd.lang.rule.Rule getRule();
|
||||
|
||||
/**
|
||||
* Get the description of this violation.
|
||||
@ -193,4 +195,9 @@ public interface RuleViolation {
|
||||
default String getFilename() {
|
||||
return getLocation().getFileId().getFileName();
|
||||
}
|
||||
|
||||
// returns the PMD 6 compatible Rule
|
||||
default net.sourceforge.pmd.Rule getRule$$bridge() { // SUPPRESS CHECKSTYLE ignore
|
||||
return getRule();
|
||||
}
|
||||
}
|
||||
|
@ -14,9 +14,9 @@ public class JavaTokenizer extends net.sourceforge.pmd.lang.java.cpd.JavaCpdLexe
|
||||
super(convertLanguageProperties(properties));
|
||||
}
|
||||
|
||||
private static final String IGNORE_LITERALS = "ignore_literals";
|
||||
private static final String IGNORE_IDENTIFIERS = "ignore_identifiers";
|
||||
private static final String IGNORE_ANNOTATIONS = "ignore_annotations";
|
||||
public static final String IGNORE_LITERALS = "ignore_literals";
|
||||
public static final String IGNORE_IDENTIFIERS = "ignore_identifiers";
|
||||
public static final String IGNORE_ANNOTATIONS = "ignore_annotations";
|
||||
|
||||
private static JavaLanguageProperties convertLanguageProperties(Properties properties) {
|
||||
boolean ignoreAnnotations = Boolean.parseBoolean(properties.getProperty(IGNORE_ANNOTATIONS, "false"));
|
||||
|
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
// This class is here just to make maven-pmd-plugin compile with
|
||||
// pmd 7.0.0 including this compat6 module.
|
||||
// It would only be used, if a custom language (other than java, jsp or javascript)
|
||||
// would be requested.
|
||||
|
||||
package net.sourceforge.pmd.cpd;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
public final class LanguageFactory {
|
||||
private LanguageFactory() {
|
||||
// utility class
|
||||
}
|
||||
|
||||
public static Language createLanguage(String name, Properties properties) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
// The class net.sourceforge.pmd.Rule has been moved into sub-package rule
|
||||
// in 7.0.0-SNAPSHOT. All rules should be interchangeable.
|
||||
|
||||
package net.sourceforge.pmd.lang.rule;
|
||||
|
||||
public interface Rule extends net.sourceforge.pmd.Rule {
|
||||
}
|
@ -27,6 +27,8 @@ import net.sourceforge.pmd.cache.NoopAnalysisCache;
|
||||
import net.sourceforge.pmd.internal.util.ClasspathClassLoader;
|
||||
import net.sourceforge.pmd.lang.Language;
|
||||
import net.sourceforge.pmd.lang.LanguageRegistry;
|
||||
import net.sourceforge.pmd.lang.rule.RulePriority;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSetLoader;
|
||||
import net.sourceforge.pmd.renderers.Renderer;
|
||||
import net.sourceforge.pmd.renderers.RendererFactory;
|
||||
import net.sourceforge.pmd.util.AssertionUtil;
|
||||
|
@ -42,6 +42,10 @@ import net.sourceforge.pmd.lang.LanguageVersion;
|
||||
import net.sourceforge.pmd.lang.LanguageVersionDiscoverer;
|
||||
import net.sourceforge.pmd.lang.document.FileCollector;
|
||||
import net.sourceforge.pmd.lang.document.TextFile;
|
||||
import net.sourceforge.pmd.lang.rule.Rule;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSet;
|
||||
import net.sourceforge.pmd.lang.rule.RuleSetLoader;
|
||||
import net.sourceforge.pmd.lang.rule.internal.RuleSets;
|
||||
import net.sourceforge.pmd.renderers.Renderer;
|
||||
import net.sourceforge.pmd.reporting.ConfigurableFileNameRenderer;
|
||||
import net.sourceforge.pmd.reporting.FileAnalysisListener;
|
||||
|
@ -20,6 +20,7 @@ import net.sourceforge.pmd.annotation.Experimental;
|
||||
import net.sourceforge.pmd.annotation.InternalApi;
|
||||
import net.sourceforge.pmd.lang.document.FileId;
|
||||
import net.sourceforge.pmd.lang.document.TextFile;
|
||||
import net.sourceforge.pmd.lang.rule.Rule;
|
||||
import net.sourceforge.pmd.renderers.AbstractAccumulatingRenderer;
|
||||
import net.sourceforge.pmd.reporting.FileAnalysisListener;
|
||||
import net.sourceforge.pmd.reporting.GlobalAnalysisListener;
|
||||
|
@ -23,6 +23,7 @@ import net.sourceforge.pmd.lang.document.FileLocation;
|
||||
import net.sourceforge.pmd.lang.document.TextRange2d;
|
||||
import net.sourceforge.pmd.lang.rule.AbstractRule;
|
||||
import net.sourceforge.pmd.lang.rule.ParametricRuleViolation;
|
||||
import net.sourceforge.pmd.lang.rule.Rule;
|
||||
import net.sourceforge.pmd.properties.PropertyDescriptor;
|
||||
import net.sourceforge.pmd.reporting.FileAnalysisListener;
|
||||
import net.sourceforge.pmd.reporting.ViolationDecorator;
|
||||
|
@ -10,6 +10,7 @@ import java.util.Map;
|
||||
import net.sourceforge.pmd.annotation.DeprecatedUntil700;
|
||||
import net.sourceforge.pmd.lang.document.FileId;
|
||||
import net.sourceforge.pmd.lang.document.FileLocation;
|
||||
import net.sourceforge.pmd.lang.rule.Rule;
|
||||
|
||||
/**
|
||||
* A RuleViolation is created by a Rule when it identifies a violation of the
|
||||
|
@ -15,6 +15,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import net.sourceforge.pmd.Report.SuppressedViolation;
|
||||
import net.sourceforge.pmd.lang.ast.AstInfo;
|
||||
import net.sourceforge.pmd.lang.ast.Node;
|
||||
import net.sourceforge.pmd.lang.rule.Rule;
|
||||
import net.sourceforge.pmd.lang.rule.xpath.XPathVersion;
|
||||
import net.sourceforge.pmd.lang.rule.xpath.internal.DeprecatedAttrLogger;
|
||||
import net.sourceforge.pmd.lang.rule.xpath.internal.SaxonXPathRuleQuery;
|
||||
|
@ -27,7 +27,6 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import net.sourceforge.pmd.PMDVersion;
|
||||
import net.sourceforge.pmd.Report.ProcessingError;
|
||||
import net.sourceforge.pmd.RuleSets;
|
||||
import net.sourceforge.pmd.RuleViolation;
|
||||
import net.sourceforge.pmd.annotation.InternalApi;
|
||||
import net.sourceforge.pmd.benchmark.TimeTracker;
|
||||
@ -38,6 +37,7 @@ import net.sourceforge.pmd.internal.util.IOUtil;
|
||||
import net.sourceforge.pmd.lang.document.FileId;
|
||||
import net.sourceforge.pmd.lang.document.TextDocument;
|
||||
import net.sourceforge.pmd.lang.document.TextFile;
|
||||
import net.sourceforge.pmd.lang.rule.internal.RuleSets;
|
||||
import net.sourceforge.pmd.reporting.FileAnalysisListener;
|
||||
|
||||
/**
|
||||
|
@ -8,11 +8,11 @@ import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.pmd.RuleSets;
|
||||
import net.sourceforge.pmd.RuleViolation;
|
||||
import net.sourceforge.pmd.annotation.InternalApi;
|
||||
import net.sourceforge.pmd.lang.document.TextDocument;
|
||||
import net.sourceforge.pmd.lang.document.TextFile;
|
||||
import net.sourceforge.pmd.lang.rule.internal.RuleSets;
|
||||
import net.sourceforge.pmd.reporting.FileAnalysisListener;
|
||||
import net.sourceforge.pmd.reporting.GlobalAnalysisListener;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user