SonarLint does not respect "skipProject = true"

Even though skipProject = true is properly respected in SonarQube analysis (module not listed) it seems that SonarLint does not care about this property and still lists violations. Is this behavior by design?

  • Gradle 5.x / Android Gradle 3.x / Gradle SonarQube 2.7
  • error observed: SonarQube violations are shown
  • steps to reproduce: Set SonarQube skipProject property to true and add a violation found by SonarLint

Hi @Alix

Sorry for the late answer.

skipProject is a scanner feature, and we generally don’t map scanner configuration to SonarLint, for various reasons. If you are still interested by this issue, could you please help us to understand why this module is excluded (=use case)?

Also, you can configure a file exclusion pattern on project configuration in your SonarQube server, and SonarLint will honor it.

Hi @Julien_HENRY,

our use case is that we are building an SDK and have a module with a test app (not shipped to production). We don’t want the test app code quality to affect the overall score.

OK, I understand the use case for SonarQube, where you don’t want bad measures (like low coverage, duplication, …) of your test module to affect the quality gate. But for SonarLint, do you think it is a problem to report issues when you open the source code of this module? I personally like to have some linting even if the code is not for production.
Or maybe some rules are too noisy in this case? In this case maybe we could improve the rules?

As a last option, you can configure a source file exclusion pattern on the server, and SonarLint will honor it.

Hi @Julien_HENRY,
good point. I’m not sure what prompted me to write this post. It was some time ago.
In general I agree with you about it being nice to see violations anyway.

One reason that I can think of is that when making changes to the test app module SonarLint performs analysis and gives warnings (I know this is an optional flag) and then it could be annoying if the rule violations are not really that interesting.

OK, I will close that thread, don’t hesitate to open a new one if you encounter annoying rules. This is something we try to avoid by making rules smarter.