Skip to content

Commit

Permalink
Issue #498: update to checkstyle 10.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
muhlba91 committed Jan 29, 2024
1 parent 8462c9e commit bcf081f
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ install)
;;

integration-tests)
SONAR_APP_VERSION="8.9.3.48735"
SONAR_APP_VERSION="9.9.0.65466"
if [[ ! -f ~/.m2/sonar-application-$SONAR_APP_VERSION.zip ]]; then
URL="https://repox.jfrog.io/repox/sonarsource/org/sonarsource/sonarqube/"
URL=$URL"sonar-application/$SONAR_APP_VERSION/sonar-application-$SONAR_APP_VERSION.zip"
Expand Down
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
build-project:
docker:
- image: cimg/openjdk:11.0.16
- image: cimg/openjdk:21.0.2

steps:
- checkout
Expand All @@ -15,7 +15,7 @@ jobs:

execute-sonar:
docker:
- image: sonarqube:9.0-community
- image: sonarqube:9.9-community
working_directory: ~/repo

environment:
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/sonar-checkstyle-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,39 @@ on:
pull_request:

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

integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: 'temurin'
- name: run integration tests
run: "./.ci/ci.sh integration-tests"

nondex:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: 'temurin'
- name: install
run: "./.ci/ci.sh nondex"

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install:
matrix:
fast_finish: true
include:
- jdk: openjdk11
- jdk: openjdk21
env: CMD="./.ci/ci.sh install"

script:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Compatibility matrix from checkstyle team:

| Checkstyle Plugin | Sonar min | Sonar max | Checkstyle | Jdk |
|-------------------|-----------|-----------|------------|-----|
| 10.12.5 | 9.0 | 10.0+ | 10.12.5 | 11 |
| 10.13.0 | 9.9 | 10.0+ | 10.13.0 | 11 |
| 10.12.5 | 9.9 | 10.0+ | 10.12.5 | 11 |
| 10.12.3 | 9.0 | 10.0+ | 10.12.3 | 11 |
| 10.12.1 | 9.0 | 10.0+ | 10.12.1 | 11 |
| 10.12.0 | 9.0 | 10.0+ | 10.12.0 | 11 |
Expand Down
13 changes: 6 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@
</ciManagement>

<properties>
<checkstyle.version>10.12.5</checkstyle.version>
<sonar.version>8.9.0.43852</sonar.version>
<checkstyle.version>10.13.0</checkstyle.version>
<sonar-java.version>7.2.0.26923</sonar-java.version>
<maven.sevntu.checkstyle.plugin.version>1.44.1</maven.sevntu.checkstyle.plugin.version>
<!-- it should be a version of checkstyle that is compatible/compiled with sevntu -->
Expand Down Expand Up @@ -158,15 +157,15 @@
<version>32.0.0-jre</version>
</dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<groupId>org.sonarsource.api.plugin</groupId>
<artifactId>sonar-plugin-api</artifactId>
<version>${sonar.version}</version>
<version>9.9.0.229</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-plugin-api-impl</artifactId>
<version>${sonar.version}</version>
<version>9.9.0.65466</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -225,7 +224,7 @@
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-testing-harness</artifactId>
<scope>test</scope>
<version>${sonar.version}</version>
<version>9.9.0.65466</version>
</dependency>
<dependency>
<groupId>org.sonarsource.orchestrator</groupId>
Expand Down Expand Up @@ -266,7 +265,7 @@
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-ws</artifactId>
<version>${sonar.version}</version>
<version>9.9.0.65466</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
21 changes: 9 additions & 12 deletions src/it/java/org/checkstyle/plugins/sonar/RunPluginTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
*/
public class RunPluginTest {
private static final Logger LOG = LoggerFactory.getLogger(RunPluginTest.class);
private static final String SONAR_APP_VERSION = "8.9.3.48735";
private static final String SONAR_APP_VERSION = "9.9.0.65466";
private static final int LOGS_NUMBER_LINES = 200;
private static final String TRUE = "true";
private static final String PROJECT_KEY = "com.puppycrows.tools:checkstyle";
Expand All @@ -83,8 +83,8 @@ public class RunPluginTest {
public static void beforeAll() {
orchestrator = Orchestrator.builderEnv()
.setZipFile(new File("target/temp-downloads/sonar-application-"
+ SONAR_APP_VERSION
+ ".zip"))
+ SONAR_APP_VERSION
+ ".zip"))
.setEdition(Edition.COMMUNITY)
.addPlugin(FileLocation.byWildcardMavenFilename(new File("target"),
"checkstyle-sonar-plugin-*.jar"))
Expand Down Expand Up @@ -129,18 +129,17 @@ private static void executeBuildWithCommonProperties(Build<?> build, boolean bui
.setProperty("sonar.java.failOnException", TRUE);

final BuildResult buildResult;
// if build fail, job is not violently interrupted, allowing time to dump SQ logs
// if build fail, job is not violently interrupted, allowing time to dump SQ
// logs
if (buildQuietly) {
buildResult = orchestrator.executeBuildQuietly(build);
}
else {
} else {
buildResult = orchestrator.executeBuild(build);
}

if (buildResult.isSuccess()) {
assertNoDifferences();
}
else {
} else {
dumpServerLogs();
fail("Build failure for project: " + PROJECT_NAME);
}
Expand All @@ -153,8 +152,7 @@ private static void assertNoDifferences() {

Assertions.assertThat(differences)
.isEmpty();
}
catch (IOException exception) {
} catch (IOException exception) {
LOG.error("Failed to read LITS differences.", exception);
fail("LITS differences not computed.");
}
Expand Down Expand Up @@ -223,8 +221,7 @@ private File prepareProject() throws IOException {
final String profileKey = ((Map<String, String>) map.get("profile")).get("key");
if (StringUtils.isEmpty(profileKey)) {
fail("Could not retrieve profile key: setting up quality profile failed.");
}
else {
} else {
final HttpResponse activateRulesResponse = orchestrator.getServer()
.newHttpCall("api/qualityprofiles/activate_rules")
.setAdminCredentials()
Expand Down

0 comments on commit bcf081f

Please sign in to comment.