Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Ktlint for all modules by executing single task command

I have multiple modules in my android project. I have one Gradle file which having code for ktlint. I applied that Gradle file to every module by writing this in the project Gradle file.

subprojects { subProject ->
    apply from: "$project.rootDir/commonFiles/gradleScript/kotlin-code-quality.gradle"
}

now the problem is I can run ktlint on each module by giving their name in command like this.

Running ktlint for cache module.

./gradlew :cache:ktlint

but I need to run all modules ktlint at once.

Here is my open-source repository and pull request on which I need to perform ktlint action.

like image 629
Happy Singh Avatar asked Oct 21 '25 10:10

Happy Singh


1 Answers

Sorry, it's my bad. ./gradlew ktlint will always run on multimodule. I had some lint checks fail in the app module. I thought it is running only on the app module.

but when I fixed the app module's lint and ran the ./gradlew ktlint. it jumped to the cache module.

I hope it helps you Thanks.

like image 105
Happy Singh Avatar answered Oct 23 '25 01:10

Happy Singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!