Style rules enforced by pre-commit hooks and CI. Violations block commits and PRs. See compiler-cautions.md section 12 for KWStyle-specific pitfalls.
./Utilities/SetupForDevelopment.shConfigures git hooks (pre-commit clang-format, commit-msg KWStyle check) and remote setup. Required before your first commit.
clang-format 19.1.7 is enforced automatically by the pre-commit hook.
Utilities/Maintenance/clang-format.bash --modified # Format modified files onlyThe hook modifies files in place; re-stage and recommit if it changes anything.
Do not use --no-verify to bypass — the format check exists to keep CI green.
The kw-commit-msg.py hook enforces:
- Subject line ≤78 characters
- Approved commit-subject prefix — see git-commits.md § Prefixes for the list
KWStyle also checks that every header has the doxygen \class tag. See
compiler-cautions.md section 12a for the
enum class pitfall where KWStyle requires \class on enum declarations.
| Entity | Convention | Example |
|---|---|---|
| Classes | PascalCase | MedianImageFilter |
| Variables | camelCase | imageSize |
| Member variables | m_ prefix |
m_Radius |
| Template parameters | T or V prefix |
TInputImage, VDimension |
| Macros | ALL_CAPS | ITK_UPPERCASE_MACRO |
constexprinstead of#definefor constants- Smart pointers for all ITK objects:
auto image = ImageType::New(); - American English spelling throughout
- Doxygen comments use backslash style:
\class,\brief - No
using namespacein headers
- Azure Pipelines — Linux, Windows, macOS (C++ and Python)
- GitHub Actions — Pixi builds, Apple Silicon
- CDash — https://open.cdash.org/index.php?project=Insight