kotlinter-gradle
kotlinter-gradle copied to clipboard
Opt-out of lint task on `check`
The README for this project states that kotlinter-gradle automatically makes the check task dependent on the lint task. Is there a way to opt out of this behaviour? My team does not want builds to fail because of linter errors and removing tasks is deprecated as of gradle 6.
Are there any other ways to opt-out of linting on check?
Need to test, but I believe there should be a way in the gradle DSL. Might want to use afterEvaluate to edit the dependsOn of the check tasks.
https://stackoverflow.com/questions/68800375/gradle-how-to-remove-task-dependency
I can throw a couple of ideas as well:
- You can exclude lint by calling
./gradlew check -x lintKotlinwhich will run the check task without running codestyle check on it. - Knowing most of codestyle offences can be autocorrected, then maybe:
./gradlew formatKotlin checkwould be a solution for you? It doesn't do precisely what you asked, but will reduce the number of builds failed because of linter errors. - Depending on what's your goal for
checktask, you can register your owncheckDevtask and configure it to run a subset of all checks you have registered in the project
I believe it is possible to opt out of check being dependent on lintKotlin with the available gradle DSL config options, so closing for now.