Lint Skill
Check code quality and formatting before committing changes.
Usage
Run this skill to check for lint errors and formatting issues.
Instructions
C Code
Check C/C++ formatting against .clang-format:
clang-format --dry-run -Werror <modified .c and .h files>
If formatting check fails, apply formatting:
clang-format -i <modified .c and .h files>
Verify the project compiles without warnings-as-errors:
./build.sh
The CMake build promotes key warnings to errors (-Werror=incompatible-pointer-types,
-Werror=implicit-function-declaration). A successful build confirms these pass.
Rust Code
Run the lint check:
make lint
If clippy reports warnings or errors, fix them before proceeding
Check formatting:
make fmt CHECK=1
If formatting check fails, apply formatting:
make fmt
If license headers are missing, add them:
(cd src/redisearch_rs && cargo license-fix) # subshell: custom subcommand, no --manifest-path
Common Clippy Fixes
- Document unsafe blocks: Add
// SAFETY: comment explaining why the unsafe code is sound
- Use
#[expect(...)]: Prefer over #[allow(...)] for lint suppressions
Rust-Only Quick Check
cargo clippy --manifest-path src/redisearch_rs/Cargo.toml --all-targets --all-features