Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable sonarlint automatic analysis in Eclipse by default

We recently added SonarLint to our default Eclipse install, but only use sonarlint on some new projects. While we have been quite happy with sonarlint on these projects, having automatic analysis defaulting to on for all of our legacy projects, slows down Eclipse start-up.

I could go through the 600+ projects and add a .settings/org.sonarlint.eclipse.core.prefs file containing autoEnabled=false, but I would rather have projects default to false and add an autoEnabled=true prefs file for just the projects where we have made an effort to adhere to sonarlint rules.

Is there any way to do this?

I looked at Disable Sonarlint automatic scan for Eclipse Remote Systems Explorer, but the top voted answer just suggests doing something I'm explicitly trying to avoid having to do, i.e setting prefs on 600+ projects and the other answer doesn't seem to help either.

like image 434
Mark Booth Avatar asked Feb 14 '18 12:02

Mark Booth


People also ask

How do I stop automatic SonarLint analysis in Intellij?

In Android Studio 3.5. 2: Go to File -> Settings -> Tools -> SonarLint -> Settings(Tab) then uncheck the Automatically trigger analysis check box.

How do I remove SonarLint?

Once you have disabled automatic analysis, you can simply delete all existing markers (in SonarLint Issues view, select the one you want to delete, right click -> delete).

How do you change SonarLint rules in Eclipse?

Open the “SonarLint Bindings” view in Eclipse, right click on your connection, and click “Update all projects bindings”. I know the root cause. It is because these rules are default not activated. I shoud copy the built-in profile and activate them, then Update All Project Bindings from SonarLint.

How do I turn on sonar lint in Eclipse?

@pippilongstocking The first things is to enable it for a project: you right click over a project (in the project view), Configure -> Enable SonarLint. Then, files should be automatically analyse when opening them or saving them.


2 Answers

From this discussion it seems that there's no way to disable automatic analysis globally by default. But there's a workaround: you can add sonar.exclusions properties for your files in the analyzer configuration (Window->Preferences->SonarLint->Analyzer Properties).

for example sonar.exclusions=**/*.js excludes all *.js files from automatic analysis

like image 83
SergeyLebedev Avatar answered Sep 23 '22 00:09

SergeyLebedev


This worked for me:

Window->Preferences->SonarLint->File Exclusions Then New GLOB Pattern: "**/*"

like image 33
sAGIT Avatar answered Sep 24 '22 00:09

sAGIT