From 69439c46b2120d5c50aca2e4f5fb453185651b2d Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 8 Dec 2020 14:47:35 -0800 Subject: [PATCH] Clean up astyle invocations based on @gendankenexperimenter's KeyboardioHID cleanups --- .astylerc | 7 +++++++ Makefile | 8 ++++++-- bin/astyle-check | 7 ------- bin/run-astyle | 4 ---- 4 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 .astylerc delete mode 100755 bin/astyle-check delete mode 100755 bin/run-astyle diff --git a/.astylerc b/.astylerc new file mode 100644 index 00000000..cb82ff6b --- /dev/null +++ b/.astylerc @@ -0,0 +1,7 @@ +style=google +unpad-paren +pad-header +pad-oper +indent-classes +indent=spaces=2 +max-continuation-indent=80 diff --git a/Makefile b/Makefile index 929c8b38..8b234dc3 100644 --- a/Makefile +++ b/Makefile @@ -64,10 +64,14 @@ find-filename-conflicts: .PHONY: astyle test cpplint cpplint-noisy shellcheck smoke-examples find-filename-conflicts prepare-virtual checkout-platform adjust-git-timestamps docker-bash docker-simulator-tests run-tests simulator-tests setup astyle: - bin/run-astyle + find ./* -type f \( -name '*.h' -o -name '*.cpp' -o -name '*.ino' \) | grep -v "testing/googletest" | xargs -n 1 astyle --project check-astyle: astyle - bin/astyle-check + if ! git diff --exit-code; then \ + >&2 echo "'astyle' found code style differences. Please make astyle and commit your changes"; \ + exit 1; \ + fi; \ + exit 0; cpplint-noisy: -bin/cpplint.py --filter=-legal/copyright,-build/include,-readability/namespace,-whitespace/line_length,-runtime/references --recursive --extensions=cpp,h,ino src examples diff --git a/bin/astyle-check b/bin/astyle-check deleted file mode 100755 index 35d16612..00000000 --- a/bin/astyle-check +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -if ! git diff --exit-code; then - >&2 echo "'make astyle' found code style differences. Please make astyle and commit your changes" - exit 1; -fi -exit 0; - diff --git a/bin/run-astyle b/bin/run-astyle deleted file mode 100755 index 7307cdc4..00000000 --- a/bin/run-astyle +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -ASTYLE_IGNORE_PATTERN='testing/googletest/' -find ./* -type f \( -name '*.h' -o -name '*.cpp' -o -name '*.ino' \) | grep -v "$ASTYLE_IGNORE_PATTERN" | xargs -n 1 astyle -q --style=google --unpad-paren --pad-header --pad-oper --indent-classes --indent=spaces=2 --max-continuation-indent=80