| 1 |
--- |
| 2 |
description: Prepare for commit - build, test, format, check, suggest commit message |
| 3 |
--- |
| 4 |
|
| 5 |
# Remove AI code slop |
| 6 |
|
| 7 |
Check the diff against main, and remove all AI generated slop introduced in this branch. |
| 8 |
|
| 9 |
This includes: |
| 10 |
- Extra comments that a human wouldn't add or is inconsistent with the rest of the file |
| 11 |
- Extra defensive checks or try/catch blocks that are abnormal for that area of the codebase (especially if called by trusted / validated codepaths) |
| 12 |
- Casts to any to get around type issues |
| 13 |
- Any other style that is inconsistent with the file |
| 14 |
|
| 15 |
Report at the end with only a 1-3 sentence summary of what you changed |
| 16 |
|
| 17 |
Complete pre-commit workflow for Rspamd project: |
| 18 |
|
| 19 |
1. Check git status to see what files are staged/modified |
| 20 |
2. **Code formatting and checks**: |
| 21 |
- C/C++ files: Run clang-format |
| 22 |
- Lua files: Run luacheck and report issues |
| 23 |
- Stage formatted files if needed |
| 24 |
3. **Build project**: |
| 25 |
- `cd ~/rspamd.build && ninja -j8 install` |
| 26 |
- Report build status |
| 27 |
4. **Run unit tests** (if build succeeds): |
| 28 |
- C/C++ tests: `test/rspamd-test-cxx` |
| 29 |
- Lua tests: `test/rspamd-test -p /rspamd/lua` |
| 30 |
- Report test results |
| 31 |
5. **Suggest commit message** following Rspamd format: |
| 32 |
- Use appropriate tag: [Feature], [Fix], [Minor], [Test], [Conf], etc. |
| 33 |
- Write clear, concise description |
| 34 |
- Remind to use `git commit -S` for GPG signing |
| 35 |
6. Ask if the user wants to proceed with the commit |
| 36 |
|
| 37 |
**NEVER MENTION** generated by or coauthored by. |