Skip to content

Commit c2869a8

Browse files
committed
ci: check android code formatting
Signed-off-by: Michael Nahkies <[email protected]>
1 parent d2c005f commit c2869a8

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

.github/workflows/android.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ jobs:
3535

3636
- name: Run tests
3737
run: make test
38+
39+
- name: Run lint
40+
run: make lint-ci

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,14 @@ checkandroidsdk: ## Check that Android SDK is installed
316316
test: gradle-dependencies ## Run the Android tests
317317
(cd android && ./gradlew test)
318318

319+
.PHONY: lint
320+
lint: gradle-dependencies ## Format the Android code
321+
(cd android && ./gradlew ktfmtFormat)
322+
323+
.PHONY: lint-ci
324+
lint-ci: gradle-dependencies ## Check the Android code is formatted
325+
(cd android && ./gradlew ktfmtCheck)
326+
319327
.PHONY: emulator
320328
emulator: ## Start an android emulator instance
321329
@echo "Checking installed SDK packages..."

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ shell.
5858
The ktmft plugin on the default setting should be used to autoformat all Java, Kotlin
5959
and XML files in Android Studio. Enable "Format on Save".
6060

61+
This is checked in CI using `make lint-ci`, and you can also run reformat the files locally
62+
using: `make lint`
63+
6164
### Docker
6265

6366
If you wish to avoid installing software on your host system, a Docker based development strategy is available, you can build and start a shell with:

0 commit comments

Comments
 (0)