com um clique
c-code-formatter
// Format C++ code in Sanmill project to ensure consistent code style; use when formatting C++ code or checking code style compliance.
// Format C++ code in Sanmill project to ensure consistent code style; use when formatting C++ code or checking code style compliance.
Batch update ARB translation files across all languages when new translation keys are added to English and Chinese files; use when adding new i18n strings to the Flutter app.
Run Sanmill's Flutter test suite, including unit tests, widget tests, and integration tests; use when running tests or checking test coverage.
Validates that all necessary code changes are implemented when adding new game rules; use when adding new game rules or variants to ensure no files are missed.
| name | C++ Code Formatter |
| description | Format C++ code in Sanmill project to ensure consistent code style; use when formatting C++ code or checking code style compliance. |
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/