Merge pull request #4804 from adangel:issue-4309-xpath-cleanups

[core] XPath cleanups #4804
This commit is contained in:
Andreas Dangel
2024-02-09 16:21:24 +01:00
87 changed files with 918 additions and 655 deletions

View File

@@ -5,9 +5,9 @@
package net.sourceforge.pmd.lang.kotlin.rule.xpath.internal;
import net.sourceforge.pmd.lang.kotlin.KotlinLanguageModule;
import net.sourceforge.pmd.lang.rule.xpath.impl.AbstractXPathFunctionDef;
import net.sourceforge.pmd.lang.rule.xpath.impl.XPathFunctionDefinition;
abstract class BaseKotlinXPathFunction extends AbstractXPathFunctionDef {
abstract class BaseKotlinXPathFunction extends XPathFunctionDefinition {
protected BaseKotlinXPathFunction(String localName) {
super(localName, KotlinLanguageModule.getInstance());

View File

@@ -13,14 +13,13 @@ Rules which enforce generally accepted best practices.
since="7.0.0"
language="kotlin"
message="Function names should have non-cryptic and clear names."
class="net.sourceforge.pmd.lang.rule.XPathRule"
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_kotlin_bestpractices.html#functionnametooshort">
<description>
Function names should be easy to understand and describe the intention. Makes developers happy.
</description>
<priority>3</priority>
<properties>
<property name="version" value="3.1"/>
<property name="xpath">
<value><![CDATA[
//FunctionDeclaration/SimpleIdentifier/T-Identifier[string-length(@Text) < 3]