Skip to content

Commit

Permalink
Add .clang-format to version control; have it consistent and fixed ac…
Browse files Browse the repository at this point in the history
…ross environments
  • Loading branch information
theohax committed Sep 21, 2021
1 parent f3f3b95 commit 5d8c459
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 46 deletions.
1 change: 0 additions & 1 deletion .clang-format.base → .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ BraceWrapping:
AfterClass: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
SortIncludes: true
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,3 @@ Testing

# Autogenerated Build Prep artifacts
util/build_prep/*/prep.sh

# Autogenerated Tooling
.clang-format
1 change: 1 addition & 0 deletions ci/check-commit-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ source "$(dirname "$BASH_SOURCE")/common.sh"

if [[ ! -z $(git status --untracked-files=no --porcelain) ]]; then
echo "Code formatting differs from expected - please run ci/clang-format-all.sh"
git diff
git reset --hard HEAD > /dev/null
exit 1
fi
Expand Down
4 changes: 1 addition & 3 deletions ci/clang-format-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ set -e
source "$(dirname "$BASH_SOURCE")/detect-clang-format.sh"
source "$(dirname "$BASH_SOURCE")/common.sh"

"$REPO_ROOT/ci/update-clang-format"

find "$REPO_ROOT/nano" -iname '*.h' -o -iname '*.hpp' -o -iname '*.cpp' | xargs "$CLANG_FORMAT" -i
find "$REPO_ROOT/nano" -iname '*.h' -o -iname '*.hpp' -o -iname '*.cpp' | xargs "$CLANG_FORMAT" -i -style=file
39 changes: 0 additions & 39 deletions ci/update-clang-format

This file was deleted.

0 comments on commit 5d8c459

Please sign in to comment.