Browse Source

[Minor] Add some of my cursor rules

cursor/RSP-271-implement-metadefender-hash-lookup-module-113a
Vsevolod Stakhov 2 days ago
parent
commit
f73464ccc1
No known key found for this signature in database GPG Key ID: 7647B6790081437
  1. 4
      .cursor/rules/commits-and-tags.mdc
  2. 23
      .cursor/rules/rspamd.mdc

4
.cursor/rules/commits-and-tags.mdc

@ -22,6 +22,8 @@ Use one of the following tags at the beginning of commit messages:
- `[Test]` - Test additions or modifications
- `[Rules]` - Changes to spam detection rules
Prefer `[Minor]` if a fix or a change is minor (e.g. whitespaces change or a missing nil check).
## Commit Message Examples
**Version updates:**
@ -148,4 +150,4 @@ set(RSPAMD_VERSION_PATCH Z)
- One logical change per commit
- Reference issue numbers when applicable
- Keep commit history clean and meaningful
- Always sign commits and tags with GPG
- Always sign commits and tags with GPG

23
.cursor/rules/rspamd.mdc

@ -0,0 +1,23 @@
---
description: "Rspamd: code style, code checks, and special project requirements"
globs: ["src/**", "lualib/**", "rules/**"]
alwaysApply: true
---
# C and C++
- For all C and C++ code changes, run `clang-format` using the `.clang-format` file located in the project root.
- Always follow the formatting specified in this file, and ensure formatting is applied before every commit.
- Do NOT use C++ standard library hash maps (`std::unordered_map`, `std::hash`). Always use containers from `contrib/ankerl/unordered_dense` for maps/sets and related hashes.
# Lua (src/plugins/lua/, lualib/, rules/)
- Run `luacheck src/plugins/lua/ lualib/ rules/` before every commit.
- Make sure you change to the project root directory before running luacheck.
- Resolve all luacheck warnings except those explicitly permitted by project exceptions.
- rspamd_logger uses `%s` in the format strings for all arguments placeholders
# Logging and Debug
- All debug logging functions use a custom `printf` format string implementation. Before touching or adding logging code, read the comments in `src/libutil/printf.h` and follow the style and requirements described there.
# General principles
- Do not introduce changes that conflict with these rules or established project practices.
- If unsure, consult Rspamd maintainers or refer to in-code comments.
Loading…
Cancel
Save