diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..b4cc211 --- /dev/null +++ b/.clang-format @@ -0,0 +1,9 @@ +--- +BasedOnStyle: Microsoft +AlignAfterOpenBracket: Align +ConstructorInitializerIndentWidth: '4' +ContinuationIndentWidth: '4' +TabWidth: '4' +UseTab: Never + +... diff --git a/lint.sh b/lint.sh new file mode 100644 index 0000000..414b752 --- /dev/null +++ b/lint.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +if (( $# < 1 )); then + >&2 echo "Illegal number of parameters" + exit 1 +fi + +# save unsaved work +git stash --include-untracked + +clang-format -i "$@" + +git add -A && git commit -m "Lint" + +git stash pop