12-December-2020 - 6.30.0
The PMD team is pleased to announce PMD 6.30.0.
This is a minor release.
New and noteworthy
The C# module now supports the new option
--ignore-literal-sequences, which can be used to avoid detection of some uninteresting clones. Support for other languages may be added in the future. See #2945
Type information for VisualForce
The Visualforce AST now can resolve the data type of Visualforce expressions that reference Apex Controller properties and Custom Object fields. This feature improves the precision of existing rules, like
This can be configured using two environment variables:
PMD_VF_APEXDIRECTORIES: Comma separated list of directories for Apex classes. Absolute or relative to the Visualforce directory. Default is
../classes. Specifying an empty string will disable data type resolution for Apex Controller properties.
PMD_VF_OBJECTSDIRECTORIES: Comma separated list of directories for Custom Objects. Absolute or relative to the Visualforce directory. Default is
../objects. Specifying an empty string will disable data type resolution for Custom Object fields.
This feature is experimental, in particular, expect changes to the way the configuration is specified. We’ll probably extend the CLI instead of relying on environment variables in a future version.
Thanks to Jeff Bartolotta and Roopa Mohan for contributing this!
- #2938: [cs] CPD: ignoring using directives could not be disabled
- #2480: [scala] Support CPD suppressions
Around RuleSet parsing
RuleSetFactoryUtilshave been deprecated in favor of
RuleSetLoader. This is easier to configure, and more maintainable than the multiple overloads of
- Some static creation methods have been added to
RuleSetfor simple cases, eg
forSingleRule. These replace some counterparts in
RuleSetsis also deprecated, many APIs that require a RuleSets instance now are deprecated, and have a counterpart that expects a
RuleSetFactoryCompatibilityare deprecated. They are most likely not relevant outside of the implementation of pmd-core.
Many classes around PMD’s entry point (
PMD) have been deprecated as internal, including:
- The contents of the packages
- The constructors of
PMD(the class will be made a utility class)
ASTTypeParameter#getParameterNameand the corresponding XPath attributes. In both cases they’re replaced with a new method
getName, the attribute is
ASTClassOrInterfaceBody#isEnumChild, refs #905
Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the
@InternalApi annotation. You’ll also get a deprecation warning.
- #2864: [vf] Provide expression type information to Visualforce rules to avoid false positives - Jeff Bartolotta
- #2914: [core] Include rule name in text renderer - Gunther Schrijvers
- #2925: Cleanup: Correct annotation array initializer indents from checkstyle #8083 - Abhishek Kumar
- #2929: [scala] Add support for CPD-ON and CPD-OFF special comments - Andy Robinson
- #2936: [java] (doc) Fix typo: “an accessor” not “a” - Igor Moreno
- #2938: [cs] CPD: fix issue where ignoring using directives could not be disabled - Maikel Steneker
- #2945: [cs] Add option to ignore sequences of literals - Maikel Steneker
- #2962: [cpp] Add support for C++ 14 binary literals - Maikel Steneker
- 190 commits
- 25 closed tickets & PRs
- Days since last release: 49