ワンクリックで
code-quality
// Use when checking code style, running pre-commit hooks, or before committing changes to ensure compliance with Google style guide
// Use when checking code style, running pre-commit hooks, or before committing changes to ensure compliance with Google style guide
Use when building knowhere from source, configuring build options (CPU/GPU/DISKANN/ASAN), or troubleshooting compilation errors
Use when exploring codebase structure, understanding index implementations (HNSW, IVF, DISKANN, Sparse, MinHash), working with third-party libraries (faiss, hnswlib, DiskANN, Cardinal), or locating specific functionality
Use when committing and pushing code changes, ensures DCO compliance and pre-commit validation
Use when running unit tests, debugging test failures, or adding new test cases using Catch2 framework
| name | code-quality |
| description | Use when checking code style, running pre-commit hooks, or before committing changes to ensure compliance with Google style guide |
.clang-format in repo rootpip3 install pre-commit
pre-commit install --hook-type pre-commit --hook-type pre-push
# Run on staged files
pre-commit run
# Run on specific files
pre-commit run --files src/index/hnsw/hnsw.cc include/knowhere/index/index.h
# Run on all files
pre-commit run --all-files
# 1. Make changes
# 2. Run pre-commit on changed files
pre-commit run --files <changed-files>
# 3. Stage and commit
git add .
git commit -m "message"
| Issue | Solution |
|---|---|
| Formatting errors | Run clang-format -i <file> or let pre-commit fix it |
| Line too long | Break line at logical points, max 120 chars |
| Include order | Follow Google style: related header, C system, C++ standard, other libs, project headers |
Pre-commit hooks run automatically on commit. Fix any failures before pushing.