Skip to content

Commit fc057bd

Browse files
committed
docs: add pre-commit checklist and common pitfalls to CLAUDE.md
1 parent 9c9fa73 commit fc057bd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

CLAUDE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,21 @@ Type-specific decoders invoked by the message formatter for custom Apple log obj
109109
### Oversize String Handling
110110

111111
A key complexity: some log entries reference oversize strings stored in different tracev3 files. The example binary demonstrates the pattern — accumulate oversize entries across files, then re-process any entries that had missing data in a second pass.
112+
113+
## Pre-Commit Checklist
114+
115+
Run these in order before every commit. All must pass:
116+
117+
1. `cargo fmt -- --check` — formatting
118+
2. `cargo clippy -- -D warnings` — lints (zero warnings policy)
119+
3. `cargo test --release` — full test suite
120+
121+
Or just run `/qa` from the repo root.
122+
123+
## Common Pitfalls
124+
125+
- **`#[deny(cast_lossless)]`** — Do not use `as` for widening casts (e.g., `u8 as u64`). Use `.into()` instead. Clippy will reject the PR otherwise.
126+
- **`#![forbid(unsafe_code)]`** — This is workspace-wide. No `unsafe` blocks anywhere, including new modules.
127+
- **Oversize entries span files** — A single log entry's oversize string may live in a different tracev3 file. Always accumulate oversize entries across all files before final log reconstruction. See `examples/` for the two-pass pattern.
128+
- **Test data is external** — Tests will fail without downloading test data first (`cd tests && wget ...`). Don't assume test failures mean code is broken until you verify test data exists.
129+
- **CI runs on macOS only** — x86_64 + aarch64. Linux builds work but CI doesn't test them.

0 commit comments

Comments
 (0)