Skip to content

Commit

Permalink
Update and Ran Astyle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Sidrane committed Nov 10, 2015
1 parent 1a57ec0 commit 69c513a
Show file tree
Hide file tree
Showing 8 changed files with 579 additions and 423 deletions.
18 changes: 18 additions & 0 deletions Tools/astylerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
indent=force-tab=8
style=linux
indent-preprocessor
indent-cases
break-blocks=all
pad-oper
pad-header
unpad-paren
keep-one-line-blocks
keep-one-line-statements
align-pointer=name
align-reference=name
-n #--suffix=none
ignore-exclude-errors-x
lineend=linux
exclude=EASTL
add-brackets
max-code-length=120
33 changes: 14 additions & 19 deletions Tools/fix_code_style.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
#!/bin/sh
#!/bin/bash

ASTYLE_VER=`astyle --version`
ASTYLE_VER_REQUIRED="Artistic Style Version 2.05.1"

if [ "$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED" ]; then
echo "Error: you're using ${ASTYLE_VER}, but PX4 requires ${ASTYLE_VER_REQUIRED}"
echo "You can get the correct version here: https://github.com/PX4/astyle/releases/tag/2.05.1"
exit 1
fi

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
astyle \
--style=linux \
--indent=force-tab=8 \
--indent-cases \
--indent-preprocessor \
--break-blocks=all \
--pad-oper \
--pad-header \
--unpad-paren \
--keep-one-line-blocks \
--keep-one-line-statements \
--align-pointer=name \
--align-reference=name \
--suffix=none \
--ignore-exclude-errors-x \
--lineend=linux \
--exclude=EASTL \
--add-brackets \
--max-code-length=120 \
--options=$DIR/astylerc \
--preserve-date \
$*
Loading

0 comments on commit 69c513a

Please sign in to comment.