You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2021/11/21 09:05:22 UTC
[maven-checkstyle-plugin] branch MCHECKSTYLE-406 updated (c20e456 -> 378aae3)
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a change to branch MCHECKSTYLE-406
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git.
discard c20e456 [MCHECKSTYLE-406] Upgrade Checkstyle to 9.1
new 378aae3 [MCHECKSTYLE-406] Upgrade Checkstyle to 9.1
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (c20e456)
\
N -- N -- N refs/heads/MCHECKSTYLE-406 (378aae3)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/org/apache/maven/plugins/checkstyle/EmptyLoggingCheck.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[maven-checkstyle-plugin] 01/01: [MCHECKSTYLE-406] Upgrade Checkstyle to 9.1
Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch MCHECKSTYLE-406
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git
commit 378aae33250a70f6df2d19eadb6fe8dc4a11932d
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sun Nov 21 04:01:05 2021 +0100
[MCHECKSTYLE-406] Upgrade Checkstyle to 9.1
---
pom.xml | 6 +++---
.../apache/maven/plugins/checkstyle/EmptyLoggingCheck.java | 4 ++--
.../exec/CheckstyleReportListenerMultiSourceTest.java | 12 ++++++------
.../checkstyle/exec/CheckstyleReportListenerTest.java | 11 ++++++-----
.../maven/plugins/checkstyle/exec/CheckstyleResultsTest.java | 10 +++++-----
5 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/pom.xml b/pom.xml
index 5c463dc..980ed98 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,7 @@ under the License.
<!-- Because Checkstyle 7+ requires Java 8 -->
<javaVersion>8</javaVersion>
<mavenVersion>3.0</mavenVersion>
- <checkstyleVersion>8.41.1</checkstyleVersion>
+ <checkstyleVersion>9.1</checkstyleVersion>
<doxiaVersion>1.4</doxiaVersion>
<sitePluginVersion>3.9.1</sitePluginVersion>
<surefire.version>2.22.2</surefire.version>
@@ -278,12 +278,12 @@ under the License.
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
- <version>8.41.1</version>
+ <version>9.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-resources</artifactId>
- <version>3</version>
+ <version>4</version>
</dependency>
</dependencies>
</plugin>
diff --git a/src/it/MCHECKSTYLE-338/empty-logging-check/src/main/java/org/apache/maven/plugins/checkstyle/EmptyLoggingCheck.java b/src/it/MCHECKSTYLE-338/empty-logging-check/src/main/java/org/apache/maven/plugins/checkstyle/EmptyLoggingCheck.java
index 10d3b3e..6d8e8b4 100644
--- a/src/it/MCHECKSTYLE-338/empty-logging-check/src/main/java/org/apache/maven/plugins/checkstyle/EmptyLoggingCheck.java
+++ b/src/it/MCHECKSTYLE-338/empty-logging-check/src/main/java/org/apache/maven/plugins/checkstyle/EmptyLoggingCheck.java
@@ -27,8 +27,8 @@ import java.util.TreeSet;
import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck;
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
import com.puppycrawl.tools.checkstyle.api.FileText;
-import com.puppycrawl.tools.checkstyle.api.LocalizedMessage;
import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
+import com.puppycrawl.tools.checkstyle.api.Violation;
public class EmptyLoggingCheck
extends AbstractFileSetCheck
@@ -38,7 +38,7 @@ public class EmptyLoggingCheck
protected void processFiltered( File file, FileText lines )
throws CheckstyleException
{
- addMessages( new TreeSet<LocalizedMessage>( Collections.singleton( new LocalizedMessage( 0, 0, getMessageBundle(),
+ addMessages( new TreeSet<LocalizedMessage>( Collections.singleton( new Violation( 0, 0, getMessageBundle(),
"EmptyLoggingCheck on file " + file.getName(), new Object[0],
SeverityLevel.ERROR, getId(), getClass(), null ) ) ) );
}
diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java b/src/test/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java
index b0f8acb..0befa3b 100644
--- a/src/test/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java
+++ b/src/test/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java
@@ -20,8 +20,8 @@ package org.apache.maven.plugins.checkstyle.exec;
*/
import com.puppycrawl.tools.checkstyle.api.AuditEvent;
-import com.puppycrawl.tools.checkstyle.api.LocalizedMessage;
import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
+import com.puppycrawl.tools.checkstyle.api.Violation;
import junit.framework.TestCase;
@@ -69,21 +69,21 @@ public class CheckstyleReportListenerMultiSourceTest
AuditEvent event = new AuditEvent( this, "/source/path/file1", null );
fireFileStarted( event );
- LocalizedMessage message =
- new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass(), null );
+ Violation message =
+ new Violation( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass(), null );
fireAddError( new AuditEvent( this, "/source/path/file1", message ) );
fireFileFinished( event );
event = new AuditEvent( this, "/source/path2/file2", null );
fireFileStarted( event );
- message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.WARNING, null, getClass(), null );
+ message = new Violation( 0, 0, "", "", null, SeverityLevel.WARNING, null, getClass(), null );
fireAddError( new AuditEvent( this, "/source/path2/file2", message ) );
fireAddError( new AuditEvent( this, "/source/path2/file2", message ) );
fireFileFinished( event );
event = new AuditEvent( this, "/source/path/file3", null );
fireFileStarted( event );
- message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.ERROR, null, getClass(), null );
+ message = new Violation( 0, 0, "", "", null, SeverityLevel.ERROR, null, getClass(), null );
fireAddError( new AuditEvent( this, "/source/path/file3", message ) );
fireAddError( new AuditEvent( this, "/source/path/file3", message ) );
fireAddError( new AuditEvent( this, "/source/path/file3", message ) );
@@ -91,7 +91,7 @@ public class CheckstyleReportListenerMultiSourceTest
event = new AuditEvent( this, "/source/path2/file4", null );
fireFileStarted( event );
- message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.IGNORE, null, getClass(), null );
+ message = new Violation( 0, 0, "", "", null, SeverityLevel.IGNORE, null, getClass(), null );
fireAddError( new AuditEvent( this, "/source/path2/file4", message ) );
fireAddError( new AuditEvent( this, "/source/path2/file4", message ) );
fireAddError( new AuditEvent( this, "/source/path2/file4", message ) );
diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleReportListenerTest.java b/src/test/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleReportListenerTest.java
index eeb7cc9..a6e48e0 100644
--- a/src/test/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleReportListenerTest.java
+++ b/src/test/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleReportListenerTest.java
@@ -20,8 +20,9 @@ package org.apache.maven.plugins.checkstyle.exec;
*/
import com.puppycrawl.tools.checkstyle.api.AuditEvent;
-import com.puppycrawl.tools.checkstyle.api.LocalizedMessage;
import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
+import com.puppycrawl.tools.checkstyle.api.Violation;
+
import junit.framework.TestCase;
@@ -67,20 +68,20 @@ public class CheckstyleReportListenerTest
AuditEvent event = new AuditEvent( this, "/source/path/file1", null );
fireFileStarted( event );
- LocalizedMessage message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass(), null );
+ Violation message = new Violation( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass(), null );
fireAddError( new AuditEvent( this, "/source/path/file1", message ) );
fireFileFinished( event );
event = new AuditEvent( this, "/source/path/file2", null );
fireFileStarted( event );
- message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.WARNING, null, getClass(), null );
+ message = new Violation( 0, 0, "", "", null, SeverityLevel.WARNING, null, getClass(), null );
fireAddError( new AuditEvent( this, "/source/path/file2", message ) );
fireAddError( new AuditEvent( this, "/source/path/file2", message ) );
fireFileFinished( event );
event = new AuditEvent( this, "/source/path/file3", null );
fireFileStarted( event );
- message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.ERROR, null, getClass(), null );
+ message = new Violation( 0, 0, "", "", null, SeverityLevel.ERROR, null, getClass(), null );
fireAddError( new AuditEvent( this, "/source/path/file3", message ) );
fireAddError( new AuditEvent( this, "/source/path/file3", message ) );
fireAddError( new AuditEvent( this, "/source/path/file3", message ) );
@@ -88,7 +89,7 @@ public class CheckstyleReportListenerTest
event = new AuditEvent( this, "/source/path/file4", null );
fireFileStarted( event );
- message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.IGNORE, null, getClass(), null );
+ message = new Violation( 0, 0, "", "", null, SeverityLevel.IGNORE, null, getClass(), null );
fireAddError( new AuditEvent( this, "/source/path/file4", message ) );
fireAddError( new AuditEvent( this, "/source/path/file4", message ) );
fireAddError( new AuditEvent( this, "/source/path/file4", message ) );
diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleResultsTest.java b/src/test/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleResultsTest.java
index 2c2180e..513457f 100644
--- a/src/test/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleResultsTest.java
+++ b/src/test/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleResultsTest.java
@@ -23,7 +23,7 @@ import junit.framework.TestCase;
import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
import com.puppycrawl.tools.checkstyle.api.AuditEvent;
-import com.puppycrawl.tools.checkstyle.api.LocalizedMessage;
+import com.puppycrawl.tools.checkstyle.api.Violation;
import java.util.Collections;
import java.util.Map;
@@ -75,24 +75,24 @@ public class CheckstyleResultsTest
{
Map<String, List<AuditEvent>> files = new HashMap<>();
- LocalizedMessage message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass(), null );
+ Violation message = new Violation( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass(), null );
AuditEvent event = new AuditEvent( this, "file1", message );
files.put( "file1", Collections.singletonList( event ) );
- message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.WARNING, null, getClass(), null );
+ message = new Violation( 0, 0, "", "", null, SeverityLevel.WARNING, null, getClass(), null );
List<AuditEvent> events = new ArrayList<>();
events.add( new AuditEvent( this, "file2", message ) );
events.add( new AuditEvent( this, "file2", message ) );
files.put( "file2", events );
- message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.ERROR, null, getClass(), null );
+ message = new Violation( 0, 0, "", "", null, SeverityLevel.ERROR, null, getClass(), null );
events = new ArrayList<>();
events.add( new AuditEvent( this, "file3", message ) );
events.add( new AuditEvent( this, "file3", message ) );
events.add( new AuditEvent( this, "file3", message ) );
files.put( "file3", events );
- message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.IGNORE, null, getClass(), null );
+ message = new Violation( 0, 0, "", "", null, SeverityLevel.IGNORE, null, getClass(), null );
events = new ArrayList<>();
events.add( new AuditEvent( this, "file4", message ) );
events.add( new AuditEvent( this, "file4", message ) );