-
🚨 Jenkins Failed? Start Here:
- clang-format Quick Reference
- Fast fixes for common formatting errors
- Copy-paste commands to fix issues
-
📖 Deep Dive - Understanding Everything:
- Complete clang-format & Jenkins Guide
- Line-by-line .clang-format explanation
- How Jenkins validates your code
- Error message interpretation
-
🤖 Augment AI Rules (Auto-Applied):
- Global Rules:
~/.augment/rules/c-cpp-formatting.md - These rules are automatically used by Augment AI when writing C/C++ code
- Global Rules:
| Document | Size | Purpose |
|---|---|---|
clang-format-quick-reference.md |
4.7 KB | Quick fixes, checklists, common issues |
clang-format-jenkins-guide.md |
11 KB | Complete guide with detailed explanations |
~/.augment/rules/c-cpp-formatting.md |
5.3 KB | Global AI coding rules (auto-applied) |
# Auto-fix:
clang-format -i -style=file <file># Auto-fix all modified files:
git diff --name-only | grep -E '\.(c|h)$' | xargs clang-format -i -style=file# Auto-fix:
clang-format -i -style=file <file>- Style Base: Google C++ Style Guide
- Column Limit: 120 characters
- Indentation: 2 spaces
- Function Braces: New line (
AfterFunction: true) - Control Braces: Same line (
AfterControlStatement: false)
# Format all modified C/C++ files (MOST USEFUL)
git diff --name-only | grep -E '\.(c|h)$' | xargs clang-format -i -style=file
# Check if file is correctly formatted
clang-format -style=file <file> | diff <file> - && echo "✅ OK" || echo "❌ NEEDS FORMATTING"
# Run full linter check (same as Jenkins)
make check_linters
# Format specific file
clang-format -i -style=file ap/src/wlan-drivers/ar/os_if/ar_os_if_ar_meta.h- Install "C/C++" extension by Microsoft
- Settings → Editor: Format On Save → Enable
- Settings → C_Cpp: Clang_format_style → "file"
- Settings → Editor → Code Style → C/C++
- Click "Import Scheme" → ClangFormat
- Enable "Format on Save"
" Add to .vimrc
Plugin 'rhysd/vim-clang-format'
let g:clang_format#auto_format = 1Last Updated: 2026-03-26
Project: wifi-ap (Arista Networks)