Set AllowAllConstructorInitializersOnNextLine to false. This prevents
formatting problem when initializer list is long enough to be wrapped
once, but all initializers fitted into the next line.
Turn on AlignConsecutiveMacros option.
This script is intended to be used in two situations:
- When user can't configure clang-format in code editor or IDE
- Potentially to be used in CI in the future
Normal usecase is to run this script after commit, then review and
add formatted code, and amend the commit, e.g.:
git commit -m "Edit some C++ code"
./scripts/format-commit.sh
git add -p # select formatting changes you want to use
git commit --amend
Run:
./scripts/format-commit.sh --help
to learn about other options.