Skip to content

Commit

Permalink
Update libs/build/sonarlint and plugins (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippefichet authored Oct 28, 2023
1 parent b225af3 commit 28af6fa
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 54 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
- name: Build with Maven
run: mvn clean package javadoc:jar verify spotless:check
run: mvn clean package source:jar javadoc:jar verify spotless:check
timeout-minutes: 10
21 changes: 11 additions & 10 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Analyze by SonarCloud
name: SonarCloud
on:
push:
branches:
Expand All @@ -7,25 +7,25 @@ on:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
java-version: 17
distribution: 'zulu'
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand All @@ -34,4 +34,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=philippefichet_sonarlint4netbeans
# -Dsonar.java.fileByFile=true to avoid "ECJ Unable to resolve type XXX"
run: mvn -B verify sonar:sonar -Dsonar.projectKey=philippefichet_sonarlint4netbeans -Dsonar.java.fileByFile=true
55 changes: 26 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<plugin>
<groupId>org.apache.netbeans.utilities</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<version>4.7</version>
<version>4.8</version>
<extensions>true</extensions>
<configuration>
<licenseName>Lesser GPL 2.1</licenseName>
Expand All @@ -70,7 +70,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.11.0</version>
<configuration>
<source>11</source>
<target>11</target>
Expand All @@ -80,7 +80,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.2.1</version>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
<argLine>
Expand Down Expand Up @@ -112,7 +112,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>0.8.10</version>
<executions>
<execution>
<id>prepare-agent</id>
Expand Down Expand Up @@ -141,7 +141,7 @@
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.7.5</version>
<version>1.15.1</version>
<configuration>
<verbose>true</verbose>
<excludedTestClasses>com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplJavascriptPluginTest</excludedTestClasses>
Expand All @@ -150,23 +150,23 @@
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>0.15</version>
<version>1.2.0</version>
</dependency>
</dependencies>
</plugin>
<!-- https://docs.qameta.io/allure/ -->
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.11.2</version>
<version>2.12.0</version>
<configuration>
<reportVersion>${io.qameta.allure.version}</reportVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<version>3.3.0</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
Expand All @@ -176,29 +176,21 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.2</version>
<version>3.6.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
<configuration>
<encoding>UTF-8</encoding>
<classifier>source</classifier>
</configuration>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.22.0</version>
<version>2.40.0</version>
<configuration>
<encoding>UTF-8</encoding>
<lineEndings>UNIX</lineEndings>
Expand All @@ -213,7 +205,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<configuration>
<gpgArguments>
<arg>--no-tty</arg>
Expand All @@ -226,7 +218,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M4</version>
<version>3.0.1</version>
<configuration>
<arguments>-Dgpg.passphrase=${gpg.passphrase} -Dgpg.homedir=${gpg.homedir} -Dgpg.useagent=false -Dgpg.executable=${gpg.executable}</arguments>
<goals>clean verify package javadoc:jar gpg:sign install:install deploy:deploy</goals>
Expand All @@ -235,7 +227,7 @@
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>8.0.1</version>
<version>8.4.0</version>
<configuration>
<nodeAnalyzerEnabled>false</nodeAnalyzerEnabled>
<yarnAuditAnalyzerEnabled>false</yarnAuditAnalyzerEnabled>
Expand All @@ -248,23 +240,28 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.10.0.2594</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.sonarsource.sonarlint.core</groupId>
<artifactId>sonarlint-core</artifactId>
<version>8.11.0.56591</version>
<version>9.3.1.74774</version>
</dependency>
<dependency>
<groupId>org.sonarsource.javascript</groupId>
<artifactId>nodejs-utils</artifactId>
<version>9.9.0.19492</version>
<version>9.13.0.20537</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.1</version>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down Expand Up @@ -465,11 +462,11 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.netbeans.version>RELEASE130</org.netbeans.version>
<aspectj.version>1.9.7</aspectj.version>
<aspectj.version>1.9.20.1</aspectj.version>
<assertj.version>3.23.1</assertj.version>
<org.mockito.version>4.4.0</org.mockito.version>
<io.qameta.allure.version>2.20.1</io.qameta.allure.version>
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<org.mockito.version>4.8.1</org.mockito.version>
<io.qameta.allure.version>2.24.0</io.qameta.allure.version>
<junit-jupiter.version>5.10.0</junit-jupiter.version>
<!-- like as allure -->
<org.slf4j.version>1.7.36</org.slf4j.version>
<!-- false by default -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ public final class SonarLintEngineImpl implements SonarLintEngine {

private static final Logger LOG = Logger.getLogger(SonarLintEngineImpl.class.getName());

// https://search.maven.org/artifact/org.sonarsource.java/sonar-java-plugin/
private static final String SONAR_JAVA_PLUGIN_VERSION = "7.15.0.30507";
// https://search.maven.org/artifact/org.sonarsource.javascript/sonar-javascript-plugin/
private static final String SONAR_JAVASCRIPT_PLUGIN_VERSION = "9.11.1.20218";
// https://search.maven.org/artifact/org.sonarsource.php/sonar-php-plugin/
private static final String SONAR_PHP_PLUGIN_VERSION = "3.25.0.9077";
// https://search.maven.org/artifact/org.sonarsource.html/sonar-html-plugin/
private static final String SONAR_HTML_PLUGIN_VERSION = "3.6.0.3106";
// https://search.maven.org/artifact/org.sonarsource.xml/sonar-xml-plugin/
private static final String SONAR_XML_PLUGIN_VERSION = "2.6.1.3686";
// https://central.sonatype.com/artifact/org.sonarsource.java/sonar-java-plugin
private static final String SONAR_JAVA_PLUGIN_VERSION = "7.24.0.32100";
// https://central.sonatype.com/artifact/org.sonarsource.javascript/sonar-javascript-plugin
private static final String SONAR_JAVASCRIPT_PLUGIN_VERSION = "10.7.0.22914";
// https://central.sonatype.com/artifact/org.sonarsource.php/sonar-php-plugin
private static final String SONAR_PHP_PLUGIN_VERSION = "3.32.0.10180";
// https://central.sonatype.com/artifact/org.sonarsource.html/sonar-html-plugin
private static final String SONAR_HTML_PLUGIN_VERSION = "3.9.0.3600";
// https://central.sonatype.com/artifact/org.sonarsource.xml/sonar-xml-plugin
private static final String SONAR_XML_PLUGIN_VERSION = "2.10.0.4108";
private static final String PREFIX_PREFERENCE_RULE_PARAMETER = "rules.parameters.";
private static final String PREFIX_EXCLUDE_RULE = "excludedRules";
private static final String PREFIX_RUNTIME_EXTRA_PROPERTIES_PREFERENCE = "extraProperties";
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@
package com.github.philippefichet.sonarlint4netbeans;

import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.assertj.core.groups.Tuple;
import org.sonarsource.sonarlint.core.analysis.api.ClientInputFile;
import org.sonarsource.sonarlint.core.analysis.api.Flow;
import org.sonarsource.sonarlint.core.analysis.api.QuickFix;
import org.sonarsource.sonarlint.core.client.api.common.analysis.Issue;
import org.sonarsource.sonarlint.core.commons.CleanCodeAttribute;
import org.sonarsource.sonarlint.core.commons.ImpactSeverity;
import org.sonarsource.sonarlint.core.commons.IssueSeverity;
import org.sonarsource.sonarlint.core.commons.RuleType;
import org.sonarsource.sonarlint.core.commons.SoftwareQuality;
import org.sonarsource.sonarlint.core.commons.TextRange;
import org.sonarsource.sonarlint.core.commons.VulnerabilityProbability;

/**
*
Expand Down Expand Up @@ -128,14 +134,34 @@ public TextRange getTextRange() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

@Override
public String toString() {
return "DefaultIssueTestImpl{" + "severity=" + severity + ", type=" + type + ", ruleKey=" + ruleKey + ", startLine=" + startLine + ", endLine=" + endLine + ", startLineOffset=" + startLineOffset + ", endLineOffset=" + endLineOffset + ", clientInputFile=" + clientInputFile + '}';
}

@Override
public List<QuickFix> quickFixes() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

@Override
public String toString() {
return "DefaultIssueTestImpl{" + "severity=" + severity + ", type=" + type + ", ruleKey=" + ruleKey + ", startLine=" + startLine + ", endLine=" + endLine + ", startLineOffset=" + startLineOffset + ", endLineOffset=" + endLineOffset + ", clientInputFile=" + clientInputFile + '}';
public Optional<CleanCodeAttribute> getCleanCodeAttribute() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}

@Override
public Map<SoftwareQuality, ImpactSeverity> getImpacts() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}

@Override
public Optional<String> getRuleDescriptionContextKey() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}

@Override
public Optional<VulnerabilityProbability> getVulnerabilityProbability() {
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
}

public static class Builder
Expand Down

0 comments on commit 28af6fa

Please sign in to comment.