c%2B%2B-code-formatter by calcitem/sanmill
npx skills add https://github.com/calcitem/sanmill --skill 'C++ Code Formatter'此技能帮助格式化 Sanmill 项目的 C++ 代码,以确保整个代码库的代码风格一致性和可维护性。
# 格式化所有 C++ 和 Dart 代码(将自动提交)
./format.sh
# 格式化但不自动提交
./format.sh s
该脚本格式化:
src/、include/、tests/ 目录下的所有 .h 和 .cpp 文件.clang-format 配置广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 格式化单个文件
clang-format -i src/position.cpp
# 格式化多个文件
clang-format -i src/*.cpp src/*.h
# 检查而不修改(试运行)
clang-format --dry-run --Werror src/position.cpp
.clang-format - C++ 格式化规则(项目根目录)CPPLINT.cfg - 代码风格检查规则.editorconfig - 编辑器特定设置cat .clang-format
# 使用 cpplint 检查特定文件
cpplint --config=CPPLINT.cfg src/position.cpp
# 配置文件定义了启用/禁用哪些检查
# 1. 修改代码
# 2. 格式化代码
./format.sh s
# 3. 查看更改
git diff
# 4. 如果正确,提交
git add .
git commit -m "Your commit message"
git diff --cached --name-only --diff-filter=ACM | \
grep -E '\.(cpp|h|cc|hpp)$' | \
xargs clang-format -i
.clang-format 配置// clang-format off 和 // clang-format on.clang-format 文件./format.sh 而非手动命令# 检查是否已安装
clang-format --version
# 在 Ubuntu/Debian 上安装
sudo apt-get install clang-format
# 在 macOS 上安装
brew install clang-format
用于格式化之外的额外风格检查。
格式化操作应报告:
.clang-format、CPPLINT.cfg、.editorconfig(项目根目录)format.sh(项目根目录)src/、include/、tests/每周安装量
0
代码仓库
GitHub 星标数
189
首次出现
1970年1月1日
This skill helps format Sanmill's C++ code to ensure code style consistency and maintainability across the codebase.
# Format all C++ and Dart code (will auto-commit)
./format.sh
# Format without auto-commit
./format.sh s
The script formats:
.h and .cpp files in src/, include/, tests/.clang-format configuration# Format single file
clang-format -i src/position.cpp
# Format multiple files
clang-format -i src/*.cpp src/*.h
# Check without modifying (dry-run)
clang-format --dry-run --Werror src/position.cpp
.clang-format - C++ formatting rules (project root)CPPLINT.cfg - Code style checking rules.editorconfig - Editor-specific settingscat .clang-format
# Check specific file with cpplint
cpplint --config=CPPLINT.cfg src/position.cpp
# The configuration file defines which checks to enable/disable
# 1. Make code changes
# 2. Format code
./format.sh s
# 3. Review changes
git diff
# 4. If correct, commit
git add .
git commit -m "Your commit message"
git diff --cached --name-only --diff-filter=ACM | \
grep -E '\.(cpp|h|cc|hpp)$' | \
xargs clang-format -i
.clang-format configuration// clang-format off and // clang-format on for special blocks.clang-format file./format.sh over manual commands# Check if installed
clang-format --version
# Install on Ubuntu/Debian
sudo apt-get install clang-format
# Install on macOS
brew install clang-format
For additional style checking beyond formatting.
Formatting operations should report:
.clang-format, CPPLINT.cfg, .editorconfig (project root)format.sh (project root)src/, include/, tests/Weekly Installs
0
Repository
GitHub Stars
189
First Seen
Jan 1, 1970
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
31,600 周安装