Skip to content

Commit

Permalink
sonarlint core 10 WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas3oo committed Aug 17, 2024
1 parent f05ba8a commit 47eca1d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
15 changes: 7 additions & 8 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin.nosync/test" path="src/test/java">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin.nosync/test" path="src/test/java">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="output" path="bin.nosync/main"/>
</classpath>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repositories {
dependencies {
implementation('io.github.furstenheim:copy_down:1.1')
implementation('org.apache.commons:commons-text:1.10.0')
implementation('org.sonarsource.sonarlint.core:sonarlint-core:9.8.0.76914') // 9.6.1.76766 // 9.8.0.76914 //10.4.1.78855
implementation('org.sonarsource.sonarlint.core:sonarlint-core:10.4.1.78855') // 9.8.0.76914 //10.4.1.78855

testImplementation('org.mockito:mockito-core:3.7.7')
testImplementation('org.mockito:mockito-junit-jupiter:3.7.7')
Expand Down
14 changes: 10 additions & 4 deletions src/main/java/se/solrike/sonarlint/impl/GradleClientLogOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@

import java.util.Map;

import javax.annotation.Nullable;

import org.gradle.api.logging.LogLevel;
import org.gradle.api.logging.Logger;
import org.sonarsource.sonarlint.core.commons.log.ClientLogOutput;
import org.sonarsource.sonarlint.core.commons.log.LogOutput;

/**
* @author Lucas Persson
*/
public class GradleClientLogOutput implements ClientLogOutput {
public class GradleClientLogOutput implements LogOutput {

private final Logger mLogger;

Expand All @@ -25,12 +27,16 @@ public GradleClientLogOutput(Logger logger) {
}

@Override
public void log(String formattedMessage, Level level) {
if (!supress(formattedMessage)) {
public void log(@Nullable String formattedMessage, Level level, @Nullable String stacktrace) {
if (formattedMessage != null && !supress(formattedMessage)) {
mLogger.log(sLevelMap.get(level), formattedMessage);
}
if (stacktrace != null ) {
mLogger.log(sLevelMap.get(level), stacktrace);
}
}


private boolean supress(String formattedMessage) {
return formattedMessage.startsWith("No workDir in SonarLint")
|| formattedMessage.startsWith("Analysis engine interrupted")
Expand Down

0 comments on commit 47eca1d

Please sign in to comment.