Skip to content

Commit 6d06ad6

Browse files
runningcodeclaude
andcommitted
build(samples): Bring back make format for every build
The root spotlessApply can't reach the Android sample, because the SDK build doesn't include it. make format runs spotlessApply in the root and in the sample build, and the format workflow, AGENTS.md, CONTRIBUTING.md and the create-java-pr skill use it. CONTRIBUTING.md already documented make format, which #4476 removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent d5f25ea commit 6d06ad6

5 files changed

Lines changed: 13 additions & 14 deletions

File tree

‎.claude/skills/create-java-pr/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ Derive the branch name from the changes being made. Use `feat/`, `fix/`, `ref/`,
7474
## Step 2: Format Code and Regenerate API Files
7575

7676
```bash
77-
./gradlew spotlessApply updateKotlinAbi
77+
make format api
7878
```
7979

80-
This is **required** before every PR in this repo. It formats all Java/Kotlin code via Spotless and regenerates the `.api` binary compatibility files.
80+
This is **required** before every PR in this repo. It formats all Java/Kotlin code via Spotless, including the separate builds the root `spotlessApply` doesn't reach, and regenerates the `.api` binary compatibility files.
8181
8282
If the command fails, diagnose and fix the issue before continuing.
8383

‎.github/workflows/format-code.yml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ jobs:
2020
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
2121

2222
- name: Format with spotlessApply
23-
run: |
24-
./gradlew spotlessApply
25-
./gradlew -p sentry-samples/sentry-samples-android spotlessApply
23+
run: make format
2624

2725
# actions/checkout fetches only a single commit in a detached HEAD state. Therefore
2826
# we need to pass the current branch, otherwise we can't commit the changes.

‎AGENTS.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ The project uses **Gradle** with Kotlin DSL. Key build files:
4141
## Essential Commands
4242

4343
```bash
44-
# Format code and regenerate .api files (REQUIRED before committing)
45-
./gradlew spotlessApply updateKotlinAbi
44+
# Format code in every build and regenerate .api files (REQUIRED before committing)
45+
make format api
4646

4747
# Run all tests and linter
4848
./gradlew check
@@ -77,7 +77,7 @@ resolves the per-module test task, including integration test suites, for you.
7777
3. **Use todo tracking**: Work through todo items, marking them as complete as you go
7878
4. **High-level communication**: Give high-level explanations of changes made, not step-by-step descriptions
7979
5. **Simplicity first**: Make every task and code change as simple as possible. Avoid massive or complex changes. Impact as little code as possible.
80-
6. **Format and regenerate**: Once done, format code and regenerate .api files: `./gradlew spotlessApply updateKotlinAbi`
80+
6. **Format and regenerate**: Once done, format code and regenerate .api files: `make format api`
8181
7. **Propose commit**: As final step, git stage relevant files and propose (but not execute) a single git commit command. This applies to implementation work; when the task is to open a PR, the `create-java-pr` skill takes over from here and does commit, push, and open it.
8282

8383
## Repository Skills

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@ To format the changed code and make CI happy you can run:
7373
make format
7474
```
7575

76-
or
77-
78-
```shell
79-
./gradlew spotlessApply
80-
```
76+
`./gradlew spotlessApply` alone formats only the SDK build, not the separate builds it doesn't include, such as the Android sample.
8177

8278
# Binary compatibility validation
8379

‎Makefile‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: all clean compile javadocs dryRelease update checkFormat api assembleUiTestRelease assembleUiTestCriticalRelease runUiTestCritical check preMerge publish
1+
.PHONY: all clean compile javadocs dryRelease update format checkFormat api assembleUiTestRelease assembleUiTestCriticalRelease runUiTestCritical check preMerge publish
22

33
all: stop clean javadocs compile
44
assembleUiTests: assembleUiTestRelease
@@ -25,6 +25,11 @@ dryRelease:
2525
update:
2626
./gradlew dependencyUpdates -Drevision=release
2727

28+
# Spotless formats the code. The root spotlessApply doesn't reach the separate builds.
29+
format:
30+
./gradlew spotlessApply
31+
./gradlew -p sentry-samples/sentry-samples-android spotlessApply
32+
2833
# Spotless check's code
2934
checkFormat:
3035
./gradlew spotlessJavaCheck spotlessKotlinCheck

0 commit comments

Comments
 (0)