Skip to content

Commit

Permalink
Issue #403: upgrade to checkstyle 10.0; drop java 1.8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
muhlba91 committed Mar 4, 2022
1 parent 962df96 commit 9d4a40d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 18 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/sonar-checkstyle-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@ on:
pull_request:

jobs:
mvn-install-java-8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: install
run: "./.ci/ci.sh install"

mvn-install-java-11:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ target/
.project
.settings

# ---- VSCode
.vscode/

# ---- Mac OS X
.DS_Store?
Icon?
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Compatibility matrix from checkstyle team:

| Checkstyle Plugin | Sonar min | Sonar max | Checkstyle | Jdk |
|-------------------|-----------|-----------|------------|-----|
| 10.0 | 8.9 | 8.9+ | 10.0 | 11 |
| 9.3 | 8.9 | 8.9+ | 9.3 | 1.8 |
| 9.2.1 | 8.9 | 8.9+ | 9.2.1 | 1.8 |
| 9.2 | 8.9 | 8.9+ | 9.2 | 1.8 |
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.github.checkstyle</groupId>
<artifactId>checkstyle-sonar-plugin</artifactId>
<version>9.4-SNAPSHOT</version>
<version>10.0-SNAPSHOT</version>
<packaging>sonar-plugin</packaging>

<name>Checkstyle SonarQube Plugin</name>
Expand Down Expand Up @@ -93,7 +93,7 @@
</ciManagement>

<properties>
<checkstyle.version>9.3</checkstyle.version>
<checkstyle.version>10.0</checkstyle.version>
<sonar.version>8.9.0.43852</sonar.version>
<sonar-java.version>7.2.0.26923</sonar-java.version>
<maven.checkstyle.plugin.version>3.1.2</maven.checkstyle.plugin.version>
Expand All @@ -103,7 +103,7 @@
8.35
</maven.sevntu.checkstyle.plugin.checkstyle.version>
<maven.jacoco.plugin.version>0.8.5</maven.jacoco.plugin.version>
<java.version>1.8</java.version>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- we disable ITs by default as it need download of 200MB sonar application jar -->
<skipITs>true</skipITs>
Expand Down
4 changes: 2 additions & 2 deletions src/it/java/org/checkstyle/plugins/sonar/RunPluginTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ private static void executeBuildWithCommonProperties(Build<?> build, boolean bui

private static void assertNoDifferences() {
try {
final String differences = new String(Files
.readAllBytes(new File(litsDifferencesPath()).toPath()), UTF_8);
final String differences = Files
.readString(new File(litsDifferencesPath()).toPath(), UTF_8);

Assertions.assertThat(differences)
.isEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import java.lang.reflect.Constructor;

import org.eclipse.jdt.core.dom.Modifier;
import org.junit.Test;

public class CheckstyleConstantsTest {
Expand All @@ -31,7 +32,7 @@ public class CheckstyleConstantsTest {
public void privateConstructor() throws ReflectiveOperationException {
final Constructor<CheckstyleConstants> constructor = CheckstyleConstants.class
.getDeclaredConstructor();
assertThat(constructor.isAccessible()).isFalse();
assertThat(Modifier.isPrivate(constructor.getModifiers())).isTrue();
constructor.setAccessible(true);
constructor.newInstance();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import java.lang.reflect.Constructor;

import org.eclipse.jdt.core.dom.Modifier;
import org.junit.Assert;
import org.junit.Test;
import org.sonar.api.rules.RulePriority;
Expand Down Expand Up @@ -72,7 +73,7 @@ public void privateConstructor() throws ReflectiveOperationException {
final Constructor<CheckstyleSeverityUtils> constructor = CheckstyleSeverityUtils.class
.getDeclaredConstructor();

assertThat(constructor.isAccessible()).isFalse();
assertThat(Modifier.isPrivate(constructor.getModifiers())).isTrue();
constructor.setAccessible(true);
constructor.newInstance();
}
Expand Down

0 comments on commit 9d4a40d

Please sign in to comment.