From b465ab430435bed7034f262c773b2a25b338afd1 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Fri, 31 Jul 2015 12:52:03 -0400 Subject: [PATCH] Added autoformat script/documentation --- README.md | 4 ++++ autoformat.sh | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100755 autoformat.sh diff --git a/README.md b/README.md index 2528a8d..a25e561 100644 --- a/README.md +++ b/README.md @@ -68,3 +68,7 @@ 5. Same as auto 4, but navigate around bins (not implemented) 6. Collect 1 bin then 1 tote (not implemented) 7. Collect 3 totes, collect bin, drive to AutoZone (not implemented) + +### Contributing + +This project uses [1TBS](https://en.wikipedia.org/wiki/1TBS) (Astyle Google variant with -j) and the `-xc -xn -xl -xG -j -s2 -C -S -K -N` [Astyle (2.04+)](http://astyle.sourceforge.net/) flags. diff --git a/autoformat.sh b/autoformat.sh new file mode 100755 index 0000000..f8a9d2e --- /dev/null +++ b/autoformat.sh @@ -0,0 +1,8 @@ +#!/bin/zsh +\cd "$(dirname "$0")">/dev/null +if which colout>/dev/null; then + astyle -xc -A14 -s2 -j -xG -S -K -N -xn -xl -n **/*.{cpp,h}|\grep -P '^(?!Unchanged)'|colout '(Formatted)' green +else + astyle -xc -A14 -s2 -j -xG -S -K -N -xn -xl -n **/*.{cpp,h}|\grep -P '^(?!Unchanged)' +fi +\cd ->/dev/null