Migration from 'angular/clang-format'
check-clang-format
This package only uses native clang-format and git-clang-format features to check formatting. The following commands will produce an error if the target files are not correctly formatted. So use them with husky and lint-staged.
TIP
--dry-run and -n options are equivalent.
sh
npx clang-format -Werror --dry-run example.cppsh
npx clang-format -Werror -n example.cppgit-clang-format
v1.2.0 (llvmorg-19.1.3)- latest
This feature has been supported since v1.2.0 (llvmorg-19.1.3), so migration is no longer necessary. Instead, you can use the clang-format-git or clang-format-git-python package.
v1.0.0 (llvmorg-18.1.8)-v1.1.3 (llvmorg-19.1.3)
Use husky and lint-staged for the pre-commit hook instead. See Use with husky and lint-staged for more details.