Skip to content

Spotless is not applied to feature modules (home, details)Β #50

@helpingstar

Description

@helpingstar

Spotless not applied to feature modules (feature:home, feature:details)

Hi! First of all, thank you for this amazing project πŸ™
I’ve been studying this project in detail and learning a lot from it, and while looking into the build setup, I noticed something I wanted to clarify regarding the Spotless configuration.

Background

I noticed that the following feature modules do not have the Spotless plugin applied, while all other modules in the project do.
I wanted to check whether this was intentional or possibly an oversight.

What I found

Modules WITH Spotless

  • βœ… All core modules
    (database, network, model, data, designsystem, etc.)
  • βœ… app module
  • βœ… baselineprofile module

Modules WITHOUT Spotless

  • ❌ feature:home
  • ❌ feature:details

My guess

While looking through the commit history, I found the following sequence:

  1. 6db3f88
    (May 8, 2024)
    • Feature modules did have Spotless when AndroidFeatureConventionPlugin was introduced
  2. 33badee
    (same day, ~13 minutes later)
    • Spotless was removed from feature modules during the AGP 8.4 upgrade
  3. e507073
    (May 16, 2024)
    • Spotless configuration was fixed by adding
      ktlint_function_naming_ignore_when_annotated_with=Composable

It looks like Spotless might have been temporarily removed from feature modules to address a build issue during the AGP upgrade, and possibly wasn’t added back after the configuration was fixed.

That said, I could be completely wrong πŸ˜…

Question

  • Is there a specific reason why feature modules should not use Spotless?
  • Or would it be okay to add it back for consistency with the rest of the project?

Local test results

I tested this locally by adding:

id("skydoves.pokedex.spotless")

to both feature modules.

After fixing one line-length issue in OnetimeStateIn.kt, everything worked as expected:

  • βœ… ./gradlew :feature:home:spotlessCheck :feature:details:spotlessCheck passes
  • βœ… ./gradlew assembleDebug succeeds

Offer

If this was unintentional, I’d be happy to submit a PR to add Spotless back to the feature modules.

Thanks again for the great work on this project! πŸ™

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions