Skip to content

Specify that ./gradlew spotlessApply will fix all issues in error message #2592

@veyndan

Description

@veyndan

When running ./gradlew spotlessCheck, and there's a styling error in several modules, we get an error and a suggested resolution of Run './gradlew :feature:foo:spotlessApply' to fix these violations.

If you are proficient in Gradle, you may correctly deduce that running ./gradlew spotlessApply will fix the violations in all modules. You may also correctly deduce this if you've read the docs.

Otherwise, you will:

  1. Run ./gradlew :feature:foo:spotlessApply
  2. Rerun ./gradlew spotlessCheck (perhaps because it's part of a git pre-commit hook)
  3. Get an error in another module, with the suggested resolution of Run './gradlew :feature:bar:spotlessApply' to fix these violations.
  4. Run ./gradlew :feature:bar:spotlessApply
  5. Repeat steps 2 to 4 a few times with different modules
  6. And eventually rerunning ./gradlew spotlessCheck will pass

As a mobile platform engineer, I've seen these exact steps play out with several people already. Given they are all heeding the advice of the error message already, and other developers outside of our team could be facing the same issue, could it be worth updating the error message to something like the following?

Run './gradlew :feature:foo:spotlessApply' to fix these violations. Alternatively, run './gradlew spotlessApply' to fix all violations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions