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:
- Run
./gradlew :feature:foo:spotlessApply
- Rerun
./gradlew spotlessCheck (perhaps because it's part of a git pre-commit hook)
- Get an error in another module, with the suggested resolution of
Run './gradlew :feature:bar:spotlessApply' to fix these violations.
- Run
./gradlew :feature:bar:spotlessApply
- Repeat steps 2 to 4 a few times with different modules
- 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.
When running
./gradlew spotlessCheck, and there's a styling error in several modules, we get an error and a suggested resolution ofRun './gradlew :feature:foo:spotlessApply' to fix these violations.If you are proficient in Gradle, you may correctly deduce that running
./gradlew spotlessApplywill fix the violations in all modules. You may also correctly deduce this if you've read the docs.Otherwise, you will:
./gradlew :feature:foo:spotlessApply./gradlew spotlessCheck(perhaps because it's part of a git pre-commit hook)Run './gradlew :feature:bar:spotlessApply' to fix these violations../gradlew :feature:bar:spotlessApply./gradlew spotlessCheckwill passAs 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.