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
Copy file name to clipboardExpand all lines: AGENTS.md
+5-16Lines changed: 5 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,27 +66,16 @@ See language-specific AGENTS.md for applicable logging usage
66
66
This project does not follow semantic versioning (semver); before removing public functionality, mark it as deprecated with a message pointing to the alternative.
67
67
See language-specific AGENTS.md for applicable deprecation usage
68
68
69
-
## Formatting
70
-
After making code changes, always run (or instruct the user to run):
71
-
```
72
-
./go format
73
-
```
74
-
This invokes the Rake `:format` task, which:
75
-
- Runs `buildifier` on all Bazel (`BUILD`, `*.bzl`, `WORKSPACE`) files — always, for every change
76
-
- Runs `update_copyright` to add/refresh Apache license headers — always, for every change
77
-
- Runs formatters for all bindings by default (pass `-<lang>` flags to skip specific ones, e.g. `-java`)
78
-
79
-
`./go format` auto-fixes files in place. After running it, check `git diff` to see if any files were
80
-
modified — if so, those changes must be committed. CI runs `./go format` then fails if `git diff` is
81
-
non-empty, so un-formatted code will fail CI.
82
-
For stricter lint checks beyond formatting, use `./go lint`.
83
-
84
69
## General Guidelines
85
70
- Comments should explain *why*, not *what* - prefer well-named methods over comments
86
71
- PRs should focus on one thing; we squash PRs to default `trunk` branch
87
72
- Prefer copying files to deleting and recreating to maintain git history
88
73
- Avoid running `bazel clean --expunge`
89
-
- Run or suggest running `./go format` before pushing to prevent CI failures
74
+
- Formatting is a pre-push concern, not a post-edit one. If `./scripts/format.sh --pre-push` is already in the user's pre-push hook, leave it alone — the hook handles it. If not, run or suggest `./scripts/format.sh` before pushing to avoid CI formatter failures, and recommend adding the hook (once):
75
+
```bash
76
+
#!/usr/bin/env bash
77
+
./scripts/format.sh --pre-push
78
+
```
90
79
91
80
## High risk changes (request verification before modifying unless explicitly instructed)
0 commit comments