remal-gradle-plugins / sonarlint

A plugin that executes SonarLint checks without SonarQube server
MIT License
18 stars 2 forks source link

Write migration guide for 1.5 -> 2.0 #44

Open Zabuzard opened 1 year ago

Zabuzard commented 1 year ago

Just got send here by @dependabot. We have been running 1.5.0.

It appears that there have been a few breaking changes since then. For example, it is now sonarLint, not sonarlint anymore. And the way rules are configured changed as well.

Looking at the usage-stats at Maven-Central, I am probably not the only one who got asked to migrate to 2.0.0 now. It would be helpful if someone can provide some sort of migration guide for the breaking changes 👍

Also, where is the old source code? Seems this repo only contains the code from 2.0.0 and its RCs.

remal commented 1 year ago

@Zabuzard thank you for the request!

initially, this plugin was created as a part of a huge monorepo with many Gradle plugins. Unfortunately, it was becoming harder and harder to maintain this monorepo. So, I decided to extract some of the plugins to GitHub and move away from the monorepo approach.

Version 1.x of this plugin hasn't been maintained for a while and even was removed from the monorepo, as became incompatible with some new Gradle/SonarLint version, and it would take too long for me to fix it.

I'd consider writing a migration guide but can't promise you anything. If I have time to write such a guide, I'll do it. Leaving the issue open for now.

Sorry for the late response.

jcucuzza commented 7 months ago

The example shown in the gitlab guide for 1.5.0 looks like this in 3.4.3.

1.5.0 (old)

sonarlint {
    ignoreFailures = false
    excludes {
        message 'java:S1214'
        message 'kotlin:S100'
        message 'xml:S125'
    }
    includes {
        message 'java:S4266' // Enable java:S4266 which is disabled by default
    }
    ruleParameter('java:S119', 'format', '^[A-Z][a-zA-Z0-9]*$') // Allow upper camel-case for type parameter names
}

3.4.3 (new)

sonarLint {
    ignoreFailures = false
    rules {
        enable (
            'java:S4266', // Enable java:S4266 which is disabled by default
        )
        disable (
            'java:S1214',
            'kotlin:S100',
            'xml:S125',
        )
    }
}