- edited description
Use AStyle to keep the code clean.
Issue #7
resolved
The options to run probably look something like this:
astyle --style="allman" --indent-switches --indent-namespaces --indent-classes --pad-oper --add-brackets **/*.cpp **/*.h
And on your local machine you should make that a pre-commit hook.
Comments (4)
-
reporter -
reporter I have even written a script to put a vim modeline at the top of ever C++ file.
-
reporter There is even a git pre-commit hook that makes sure that I do not mess up:
#!/bin/sh -e echo "Running AStyle before commit" ASTYLE=${ASTYLE:-astyle} case `$ASTYLE --version 2> /dev/null` in Artistic*) ;; default) echo "fuppes git pre-commit hook:" echo "Did not find astyle, please install it before continuing." exit 1 ;; esac bash scripts/run_astyle.bash "--formatted" echo "Successfully ran astyle before commit." exit 0
You should use this in the documentation.
-
reporter - changed status to resolved
This issue is now done the project gets correctly formatted all of the time.
- Log in to comment