Astyle options agreed during TC meeting 2018/10/18.
-- Note that max line length is 200 (maximum allowed by tool) -- Pre-commit hook tested and uses the same option file as CI Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
@@ -7,6 +7,10 @@ convert-tabs
|
|||||||
indent=spaces=2
|
indent=spaces=2
|
||||||
# Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block.
|
# Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block.
|
||||||
indent-switches
|
indent-switches
|
||||||
|
# Indent preprocessor blocks at bracket level 0.
|
||||||
|
indent-preproc-block
|
||||||
|
# Indent multi-line preprocessor #define statements.
|
||||||
|
indent-preproc-define
|
||||||
# Indent C++ comments beginning in column one.
|
# Indent C++ comments beginning in column one.
|
||||||
indent-col1-comments
|
indent-col1-comments
|
||||||
# Pad empty lines around header blocks
|
# Pad empty lines around header blocks
|
||||||
@@ -14,7 +18,9 @@ break-blocks
|
|||||||
delete-empty-lines
|
delete-empty-lines
|
||||||
# Attach a pointer or reference operator (*, &, or ^) to the variable name (right)
|
# Attach a pointer or reference operator (*, &, or ^) to the variable name (right)
|
||||||
align-pointer=name
|
align-pointer=name
|
||||||
# The code line length is 200 characters/columns
|
# The code line length is 200 characters/columns (this is the maximum allowed by astyle)
|
||||||
max-code-length=200
|
max-code-length=200
|
||||||
|
# If the line contains logical conditionals they will be placed first on the new line.
|
||||||
break-after-logical
|
break-after-logical
|
||||||
|
# Force use of the linux end of line
|
||||||
lineend=linux
|
lineend=linux
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@
|
|||||||
# cp pre-commit .git/hooks
|
# cp pre-commit .git/hooks
|
||||||
# chmod +x .git/hooks/pre-commit
|
# chmod +x .git/hooks/pre-commit
|
||||||
|
|
||||||
OPTIONS="--convert-tabs --indent=spaces=2 --indent-switches --indent-col1-comments --break-blocks --delete-empty-lines --align-pointer=name --keep-one-line-blocks --keep-one-line-statements --lineend=linux"
|
OPTIONS="--options=ci-scripts/astyle-options.txt"
|
||||||
|
|
||||||
RETURN=0
|
RETURN=0
|
||||||
ASTYLE=$(which astyle)
|
ASTYLE=$(which astyle)
|
||||||
@@ -28,4 +28,4 @@ if [ $RETURN -eq 1 ]; then
|
|||||||
echo $OPTIONS >&2
|
echo $OPTIONS >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit $RETURN
|
exit $RETURN
|
||||||
|
|||||||
Reference in New Issue
Block a user