Skip to content

Commit 1930668

Browse files
committed
update
1 parent 9fbf2f5 commit 1930668

File tree

2 files changed

+35
-41
lines changed

2 files changed

+35
-41
lines changed

pmd-custom_ruleset.xml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<?xml version="1.0"?>
22
<ruleset name="TheAlgorithms/Java ruleset"
3-
xmlns="http://pmd.sf.net/ruleset/1.0.0"
4-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
6-
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
7-
<description>
8-
Custom PMD checks for TheAlgorithms/Java
9-
</description>
10-
<rule name="UselessMainMethod"
11-
language="java"
12-
message="The main method is redundant in this context"
13-
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule">
3+
xmlns="http://pmd.sf.net/ruleset/1.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
6+
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
7+
148
<description>
15-
Avoid using the main method.
9+
Custom PMD checks for TheAlgorithms/Java.
1610
</description>
17-
<priority>3</priority>
18-
<properties>
19-
<property name="xpath">
20-
<value>
21-
<![CDATA[
22-
//MethodDeclaration[@Name = "main"]
23-
]]>
24-
</value>
25-
</property>
26-
</properties>
27-
</rule>
11+
12+
<rule name="UselessMainMethod"
13+
language="java"
14+
message="The main method is redundant in this context"
15+
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule">
16+
<description>
17+
Avoid using a standalone main method unless required.
18+
</description>
19+
<priority>3</priority>
20+
<properties>
21+
<property name="xpath">
22+
<value><![CDATA[
23+
//MethodDeclaration[@Name='main']
24+
]]></value>
25+
</property>
26+
</properties>
27+
</rule>
2828
</ruleset>

pom.xml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
6+
67
<groupId>com.thealgorithms</groupId>
78
<artifactId>Java</artifactId>
89
<version>1.0-SNAPSHOT</version>
@@ -66,6 +67,7 @@
6667
<forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
6768
</configuration>
6869
</plugin>
70+
6971
<plugin>
7072
<groupId>org.apache.maven.plugins</groupId>
7173
<artifactId>maven-compiler-plugin</artifactId>
@@ -80,6 +82,7 @@
8082
</compilerArgs>
8183
</configuration>
8284
</plugin>
85+
8386
<plugin>
8487
<groupId>org.jacoco</groupId>
8588
<artifactId>jacoco-maven-plugin</artifactId>
@@ -99,6 +102,7 @@
99102
</execution>
100103
</executions>
101104
</plugin>
105+
102106
<plugin>
103107
<groupId>org.apache.maven.plugins</groupId>
104108
<artifactId>maven-checkstyle-plugin</artifactId>
@@ -111,33 +115,23 @@
111115
</configuration>
112116
<dependencies>
113117
<dependency>
114-
<groupId>com.puppycrawl.tools</groupId>
115-
<artifactId>checkstyle</artifactId>
116-
<version>10.26.0</version>
118+
<groupId>com.puppycrawl.tools</groupId>
119+
<artifactId>checkstyle</artifactId>
120+
<version>10.26.0</version>
117121
</dependency>
118122
</dependencies>
119123
</plugin>
124+
120125
<plugin>
121126
<groupId>com.github.spotbugs</groupId>
122127
<artifactId>spotbugs-maven-plugin</artifactId>
123128
<version>4.9.3.1</version>
124129
<configuration>
125130
<excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
126131
<includeTests>true</includeTests>
127-
<plugins>
128-
<plugin>
129-
<groupId>com.mebigfatguy.fb-contrib</groupId>
130-
<artifactId>fb-contrib</artifactId>
131-
<version>7.6.11</version>
132-
</plugin>
133-
<plugin>
134-
<groupId>com.h3xstream.findsecbugs</groupId>
135-
<artifactId>findsecbugs-plugin</artifactId>
136-
<version>1.14.0</version>
137-
</plugin>
138-
</plugins>
139132
</configuration>
140133
</plugin>
134+
141135
<plugin>
142136
<groupId>org.apache.maven.plugins</groupId>
143137
<artifactId>maven-pmd-plugin</artifactId>
@@ -146,7 +140,7 @@
146140
<rulesets>
147141
<ruleset>/rulesets/java/maven-pmd-plugin-default.xml</ruleset>
148142
<ruleset>/category/java/security.xml</ruleset>
149-
<ruleset>file://${basedir}/pmd-custom_ruleset.xml</ruleset>
143+
<ruleset>pmd-custom_ruleset.xml</ruleset> <!-- ✅ Fixed path -->
150144
</rulesets>
151145
<printFailingErrors>true</printFailingErrors>
152146
<includeTests>true</includeTests>

0 commit comments

Comments
 (0)