question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please add a sample for how to apply kotlinter on a multi module Android project

See original GitHub issue

Hello,

Thanks for the up-to-date ktlint plugin. This is what I am looking for nowadays. I set up the plugin well but still didn’t understand how to exclude some packages in a multi module project. It was enough with ktlint-gradle to exclude project-wide packages within the plugin block itself like below

ktlint {
    exclude = ...
}

but for this one, from what I understand from the doc, I need to configure the task(lintKotlinMain, formatKotlinMain) created by the plugin in each module or is there a better and centralized way of doing so? Thank you!

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
svenjacobscommented, Sep 16, 2022

@jeremymailen I was struggling with finding the right syntax for excluding generated files.

Maybe one of the solutions in the comments that you mentioned could be added to the documentation? I personally went with:

tasks.withType<LintTask>().configureEach {
    exclude { it.file.path.contains("/build/generated/") }
}

Thank you very much for this great Gradle plugin 👍🏼

1reaction
adityabhaskarcommented, Oct 19, 2022

I spent a few hours today figuring out how to set up the pre push hook task to a multi module project. A sample project would’ve been mightily helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · jeremymailen/kotlinter-gradle - GitHub
Please add a sample for how to apply kotlinter on a multi module Android project help wanted. #256 opened on Jun 21 by...
Read more >
Guide to Android app modularization
Samples. A project with multiple Gradle modules is known as a multi-module project. This guide encompasses best practices and recommended ...
Read more >
Multi-module Android project with Kotlin DSL for Gradle
Recently, I decided to convert one of my multi-module projects to use Kotlin DSL for Gradle. The goal is to extract common configurations...
Read more >
Using the Gradle plugin - Dokka
If you are upgrading from 0.10.x to a current release of Dokka, please have a ... Gradle multi-module projects, you can use dokka${format}Multimodule...
Read more >
Don't Do These Fatal Mistakes With a Multi-Module Architecture
If you build an app with a multi - module architecture, there are many things you can do wrong. In this video I'll...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found