Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Upgrade dependencies - Mockito, Slf4j, Spotbugs, sonar-source etc #198

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
build:
strategy:
matrix:
java: [8, 11]
java: [11]
sonar:
- ""
- "8.9.0.43852"
include:
- java: 8
- java: 11
sonar: ""
archive: "yes"
- java: 11
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'adopt'

- name: Publish package
Expand Down
2 changes: 1 addition & 1 deletion codenarc-converter/CodeNarc
Submodule CodeNarc updated 608 files
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.sonarsource.parent</groupId>
<artifactId>parent</artifactId>
<version>59.0.29</version>
<version>64.0.211</version>
</parent>

<groupId>org.sonarsource.groovy</groupId>
Expand Down Expand Up @@ -98,7 +98,7 @@
<dependency>
<groupId>org.codenarc</groupId>
<artifactId>CodeNarc</artifactId>
<version>2.2.0</version>
<version>3.3.0</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When updating CodeNarc, you should update the external at the same time and use the codenarc-converter to integrate changes in codenarc rules into this plugin

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick response Tobi, i will do so.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done @TobiX , the build seems to go through.

<exclusions>
<exclusion>
<groupId>org.codehaus.groovy</groupId>
Expand Down Expand Up @@ -130,7 +130,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version>
<version>2.0.9</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -161,7 +161,7 @@
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.29.0</version>
<version>2.41.1</version>
<executions>
<execution>
<goals>
Expand Down
6 changes: 3 additions & 3 deletions sonar-groovy-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<version>4.5.3</version>
<version>4.8.3</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -93,7 +93,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.12.4</version>
<version>5.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -118,7 +118,7 @@
<configuration>
<rules>
<requireFilesSize>
<maxsize>15000000</maxsize>
<maxsize>20000000</maxsize>
<minsize>11000000</minsize>
<files>
<file>${project.build.directory}/${project.build.finalName}.jar</file>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Sonar Groovy Plugin
* Copyright (C) 2010-2021 SonarQube Community
* Copyright (C) 2010-2023 SonarQube Community
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -41,7 +41,7 @@ public void test() {
assertThat(repository.language()).isEqualTo(Groovy.KEY);

List<Rule> rules = repository.rules();
assertThat(rules).hasSize(394);
assertThat(rules).hasSize(397);

List<String> missingDebt = new LinkedList<>();
for (Rule rule : rules) {
Expand All @@ -55,7 +55,13 @@ public void test() {
}
// From SONARGROOV-36, 'org.codenarc.rule.generic.IllegalSubclassRule' does not have debt by
// purpose
assertThat(missingDebt).containsOnly("org.codenarc.rule.generic.IllegalSubclassRule.fixed");
assertThat(missingDebt)
.containsOnly(
"org.codenarc.rule.generic.IllegalSubclassRule.fixed",
"org.codenarc.rule.junit.SpockMissingAssertRule",
"org.codenarc.rule.concurrency.NoScriptBindingsRule",
"org.codenarc.rule.comments.SpaceAfterCommentDelimiterRule",
"org.codenarc.rule.comments.SpaceBeforeCommentDelimiterRule");

Rule rule = repository.rule("org.codenarc.rule.braces.ElseBlockBracesRule");
assertThat(rule.params()).hasSize(1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Sonar Groovy Plugin
* Copyright (C) 2010-2021 SonarQube Community
* Copyright (C) 2010-2023 SonarQube Community
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand All @@ -19,7 +19,7 @@
package org.sonar.plugins.groovy.surefire;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.anyString;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
Expand Down Expand Up @@ -131,7 +131,7 @@ public void shouldHandleTestSuiteDetails() throws URISyntaxException {
context
.measure(":org.sonar.core.ExtensionsFinderTest", CoreMetrics.SKIPPED_TESTS)
.value())
.isEqualTo(0);
.isZero();

assertThat(context.measure(":org.sonar.core.ExtensionsFinderTest2", CoreMetrics.TESTS).value())
.isEqualTo(2);
Expand All @@ -144,17 +144,17 @@ public void shouldHandleTestSuiteDetails() throws URISyntaxException {
context
.measure(":org.sonar.core.ExtensionsFinderTest2", CoreMetrics.TEST_FAILURES)
.value())
.isEqualTo(0);
.isZero();
assertThat(
context
.measure(":org.sonar.core.ExtensionsFinderTest2", CoreMetrics.TEST_ERRORS)
.value())
.isEqualTo(0);
.isZero();
assertThat(
context
.measure(":org.sonar.core.ExtensionsFinderTest2", CoreMetrics.SKIPPED_TESTS)
.value())
.isEqualTo(0);
.isZero();

assertThat(context.measure(":org.sonar.core.ExtensionsFinderTest3", CoreMetrics.TESTS).value())
.isEqualTo(1);
Expand All @@ -167,12 +167,12 @@ public void shouldHandleTestSuiteDetails() throws URISyntaxException {
context
.measure(":org.sonar.core.ExtensionsFinderTest3", CoreMetrics.TEST_FAILURES)
.value())
.isEqualTo(0);
.isZero();
assertThat(
context
.measure(":org.sonar.core.ExtensionsFinderTest3", CoreMetrics.TEST_ERRORS)
.value())
.isEqualTo(0);
.isZero();
assertThat(
context
.measure(":org.sonar.core.ExtensionsFinderTest3", CoreMetrics.SKIPPED_TESTS)
Expand Down Expand Up @@ -266,7 +266,7 @@ public void measuresShouldNotIncludeSkippedTests() throws URISyntaxException {

assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TESTS).value()).isEqualTo(2);
assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TEST_FAILURES).value()).isEqualTo(1);
assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TEST_ERRORS).value()).isEqualTo(0);
assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TEST_ERRORS).value()).isZero();
assertThat(context.measure(":org.sonar.Foo", CoreMetrics.SKIPPED_TESTS).value()).isEqualTo(1);
}

Expand All @@ -284,9 +284,9 @@ public void noSuccessRatioIfNoTests() throws URISyntaxException {
"/org/sonar/plugins/groovy/surefire/SurefireSensorTest/noSuccessRatioIfNoTests/")
.toURI())));

assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TESTS).value()).isEqualTo(0);
assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TEST_FAILURES).value()).isEqualTo(0);
assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TEST_ERRORS).value()).isEqualTo(0);
assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TESTS).value()).isZero();
assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TEST_FAILURES).value()).isZero();
assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TEST_ERRORS).value()).isZero();
assertThat(context.measure(":org.sonar.Foo", CoreMetrics.SKIPPED_TESTS).value()).isEqualTo(2);
}

Expand All @@ -307,7 +307,7 @@ public void ignoreSuiteAsInnerClass() throws URISyntaxException {
// ignore TestHandler$Input.xml
assertThat(
context.measure(":org.apache.shindig.protocol.TestHandler", CoreMetrics.TESTS).value())
.isEqualTo(0);
.isZero();
assertThat(
context
.measure(":org.apache.shindig.protocol.TestHandler", CoreMetrics.SKIPPED_TESTS)
Expand Down