Add Spotless Gradle plugin configuration and apply it - #73
Open
wborn wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
ktfmtwith Google style and adds OpenRemote license headers.editorconfigmatching the formatting conventionsbuildand.gradledirectories from formattingspotlessCheckduring CI and before releasesThe Gradle subproject discovery in
settings.gradlealso excludes generated directories. This prevents generatedbuild.gradlefiles, such as those temporarily created by Spotless, from being incorrectly detected as subprojects.Formatting can be applied locally using:
and checked using:
The existing sources have been formatted using the new configuration.
Merge
The two commits should preferably remain separate:
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-revsfile so the repository-wide formatting changes do not interfere withgit blame.Since rebase-and-merge rewrites commit SHAs, the resulting SHA should be added after the PR has been merged.