InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.37k stars 660 forks source link

ENH: Add pre-commit configuration file to run clang-format #4651

Open blowekamp opened 1 month ago

blowekamp commented 1 month ago

The "pre-commit" be installed congenitally or with the Utilities/GitSetup/setup-precommit installation script.

This version of clang-tidy can be run on all files by pre-commit run -a.

blowekamp commented 1 month ago

@blowekamp I love this idea!!! I have found that pre-commit is much more reliable than our custom built tools. It makes it much easier to keep the codebase clean than does our current system.

After this initial commit is in place, I'd be happy to propose a set of other changes that will make maintenance a lot easier for new developers.

You may be interested in what I did in SimpleITK: https://github.com/SimpleITK/SimpleITK/blob/master/.pre-commit-config.yaml