You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so children modules pick up the root header correctly.
32
+
> **Do not** hand-format files or hand-edit headers; let Spotless do it. Running `mvn clean install` locally will mutate sources to match the standard.
42
33
43
34
### Checkstyle
44
35
@@ -52,46 +43,15 @@ We keep **Checkstyle** to enforce additional rules. CI fails if formatting or st
52
43
53
44
***JDK 17+**
54
45
***Maven 3.8+**
55
-
***Git**, **Make**, **Bash**
46
+
***Git**
56
47
* Optional IDE plugins:
57
48
58
-
* IntelliJ: *Google Java Format* plugin (for local editing experience). Spotless remains the source of truth.
59
-
60
-
### Install the Git Hooks (one-time)
61
-
62
-
```bash
63
-
make hooks
64
-
```
65
-
66
-
This calls `scripts/install-git-hooks.sh` which sets `core.hooksPath` to `.githooks` and marks hooks executable.
67
-
68
-
### Pre-commit Hook Behavior
69
-
70
-
* Runs only on **staged**`*.java` files.
71
-
* Temporarily stashes unstaged edits (to avoid committing them), runs Spotless, **re-stages** formatted files, then restores the stash.
72
-
* If it reformats something, your commit still proceeds with the updated index.
73
-
74
-
If something goes wrong:
75
-
76
-
* Run `make format` to apply formatting to the whole repo.
77
-
* Stage changes and commit again.
78
-
79
-
---
80
-
81
-
## Make Targets
82
-
83
-
Common tasks are wrapped in a Makefile:
49
+
* IntelliJ: *Google Java Format* plugin (for local editing experience). Spotless remains the source of truth.
84
50
85
-
```text
86
-
make hooks # Install/enable repo-local git hooks
87
-
make format # Spotless apply (format + license headers)
88
-
make check # Spotless check + Checkstyle check
89
-
make verify # mvn verify (full build)
90
-
make ci # CI checks (Spotless + Checkstyle, no tests)
91
-
make clean # mvn clean
92
-
```
51
+
### Local build & formatting
93
52
94
-
> If `make` complains about a “missing separator”, ensure each command line under a target starts with a **TAB**.
53
+
* Run `mvn clean install` from the repo root. During the build, Spotless **applies** formatting and license headers.
54
+
* Before pushing, run `mvn -DskipTests spotless:check checkstyle:check` to ensure CI will pass.
95
55
96
56
---
97
57
@@ -128,10 +88,10 @@ make clean # mvn clean
128
88
* Link related issues.
129
89
* Check the box:
130
90
131
-
*[ ]`make check` passes locally
132
-
*[ ] Unit/integration tests updated
133
-
*[ ] Public API changes documented/Javadoc updated
134
-
*[ ] No unrelated formatting churn (Spotless should keep this minimal)
* Spotless inserts or normalizes it automatically.
154
-
* If the copyright line needs updates, edit the template and run `make format`.
112
+
* The license header is defined **inline** in the parent POM under Spotless’ `<licenseHeader>`.
113
+
* To update it, edit the parent POM and run `mvn spotless:apply` to propagate changes.
155
114
156
115
---
157
116
158
117
## CI
159
118
160
119
* CI runs `spotless:check` and `checkstyle:check` to ensure consistent formatting and style.
161
-
* Builds fail if formatting or headers drift. Run `make format` locally to fix.
120
+
* Builds fail if formatting or headers drift. Run `mvn spotless:apply` locally to fix.
162
121
163
122
---
164
123
165
124
## Troubleshooting
166
125
167
-
***Hook didn’t run?**Did you run `make hooks` after cloning? Check `git config --get core.hooksPath` prints `.githooks`.
168
-
***Header file not found?**Ensure Spotless uses the root path via `${maven.multiModuleProjectDirectory}/config/license-header.txt`.
169
-
***Formatting conflicts with unstaged edits?**The hook stashes them. If a conflict occurs, complete the merge in your working copy, then `git add` and commit again.
126
+
***Spotless changed files during build?**That’s expected locally. Review `git status`, then stage and commit the updates.
127
+
***CI red on formatting?**Run `mvn spotless:apply` locally, commit, and push.
128
+
***Running only a submodule?**Prefer `mvn -pl <module> -am …` from the repo root so parent config (Spotless/Checkstyle) is applied consistently.
0 commit comments