# Code formatting rules for Arduino libraries, modified from for KH libraries:
#
#   https://github.com/arduino/Arduino/blob/master/build/shared/examples_formatter.conf
#

# astyle --style=allman -s2 -t2 -C -S -xW -Y -M120 -f -p -xg -H -xb -c --xC120 -xL  *.h *.cpp *.ino

--mode=c
--lineend=linux
--style=allman

# -r or -R
#--recursive

# -c => Converts tabs into spaces
convert-tabs

# -s2 => 2 spaces indentation
--indent=spaces=2

# -t2 => tab =2 spaces
#--indent=tab=2

# -C
--indent-classes

# -S
--indent-switches

# -xW
--indent-preproc-block

# -Y => indent classes, switches (and cases), comments starting at column 1
--indent-col1-comments

# -M120 => maximum of 120 spaces to indent a continuation line
--max-continuation-indent=120

# -xC120 => max‑code‑length will break a line if the code exceeds # characters
--max-code-length=120

# -f =>
--break-blocks

# -p => put a space around operators
--pad-oper

# -xg => Insert space padding after commas
--pad-comma

# -H => put a space after if/for/while
pad-header

# -xb => Break one line headers (e.g. if/for/while)
--break-one-line-headers

# -c => Converts tabs into spaces
#--convert-tabs

# if you like one-liners, keep them
#keep-one-line-statements

# -xV
--attach-closing-while

#unpad-paren

# -xp
remove-comment-prefix

