Skip to content

Add Spotless Gradle plugin configuration and apply it - #73

Open
wborn wants to merge 2 commits into
mainfrom
use-spotless
Open

Add Spotless Gradle plugin configuration and apply it#73
wborn wants to merge 2 commits into
mainfrom
use-spotless

Conversation

@wborn

@wborn wborn commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

Add Spotless to consistently format the Android console sources, based on the formatting configuration used in the main OpenRemote repository.

This follows the Spotless adoption originally introduced for the main OpenRemote repository in openremote/openremote#1441.

The configuration:

  • formats Kotlin using ktfmt with Google style and adds OpenRemote license headers
  • formats Gradle files using GrEclipse with the OpenRemote Google-style configuration
  • formats XML using Eclipse WTP
  • formats JSON, Markdown and YAML using Prettier
  • normalizes trailing whitespace and final newlines for miscellaneous text files
  • adds an .editorconfig matching the formatting conventions
  • excludes generated build and .gradle directories from formatting
  • runs spotlessCheck during CI and before releases

The Gradle subproject discovery in settings.gradle also excludes generated directories. This prevents generated build.gradle files, such as those temporarily created by Spotless, from being incorrectly detected as subprojects.

Formatting can be applied locally using:

./gradlew spotlessApply

and checked using:

./gradlew spotlessCheck

The existing sources have been formatted using the new configuration.

Merge

The two commits should preferably remain separate:

  1. Add Spotless Gradle plugin configuration — configuration and workflow changes required to enable and enforce formatting.
  2. Apply Spotless — formatting-only changes.

To preserve this separation, this PR should be rebased and merged rather than squashed.

After merging, the resulting SHA of the Apply Spotless commit can be added to a .git-blame-ignore-revs file so the repository-wide formatting changes do not interfere with git blame.

Since rebase-and-merge rewrites commit SHAs, the resulting SHA should be added after the PR has been merged.

@wborn
wborn marked this pull request as ready for review August 28, 2026 09:52
@wborn
wborn requested a review from a team August 28, 2026 09:52
@wborn wborn self-assigned this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant