|
15 | 15 | - Chain exceptions: `raise ValueError(...) from err` |
16 | 16 | - Use `req_ctxvar_context()` for per-requirement logging |
17 | 17 | - Run `hatch run lint:fix` to format code |
| 18 | +- Always use `git commit --signoff` |
18 | 19 |
|
19 | 20 | ### Don't |
20 | 21 |
|
@@ -93,23 +94,34 @@ Look at these before writing code: |
93 | 94 |
|
94 | 95 | **Import rules:** All imports at the top of the file, no local imports. See [CONTRIBUTING.md](CONTRIBUTING.md) for details. |
95 | 96 |
|
| 97 | +**URLs:** Use the `.test` TLD (e.g. `https://pkg.test/simple/`) instead of `example.com` in tests. Use `.example` TLD in examples. |
| 98 | + |
96 | 99 | **Testing:** Use Arrange/Act/Assert pattern, name functions `test_<behavior>()`. See `tests/test_context.py` for examples. |
97 | 100 |
|
| 101 | +## Documentation and doc strings |
| 102 | + |
| 103 | +- Use single backticks around function and class names in markdown (e.g. `req_ctxvar_context()`, `WorkContext`), double backticks in .rst (reStructuredText) |
| 104 | +- Use Sphinx `versionadded`, `versionremoved`, `versionchanged` directives for user-facing changes (get next version from last git tag) |
| 105 | + |
98 | 106 | ## Commit Messages |
99 | 107 |
|
100 | 108 | Follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) — see [CONTRIBUTING.md](CONTRIBUTING.md) for format, types, and examples. |
101 | 109 |
|
102 | | -When AI agents create or significantly modify code, add attribution: |
| 110 | +Use backticks around function and class names (e.g. `WorkContext`) |
| 111 | + |
| 112 | +Always use `--signoff` to add a DCO sign-off. When AI agents create or significantly modify code, also add attribution: |
103 | 113 |
|
104 | 114 | ```text |
105 | | -feat(scope): short summary |
| 115 | +git commit --signoff -m "feat(scope): short summary |
106 | 116 |
|
107 | 117 | Body explaining what and why. |
108 | 118 |
|
109 | 119 | Co-Authored-By: Claude <claude@anthropic.com> |
110 | 120 | Closes: #123 |
111 | 121 | ``` |
112 | 122 |
|
| 123 | +This produces a commit message with both the `Signed-off-by` trailer (from `--signoff`) and the `Co-Authored-By` trailer. |
| 124 | + |
113 | 125 | ## Workflow for Complex Tasks |
114 | 126 |
|
115 | 127 | 1. **Search codebase** for similar patterns first |
|
0 commit comments