runAStyle.bat - enforce code formatting standardsΒΆ
To maintain a consistent style, this batch file runs the Artistic Style code formatter on all sources in the library.
bin\astyle --brackets=attach --indent-switches --indent=spaces=2 --recursive --exclude=build --lineend=linux --suffix=none --formatted --convert-tabs *.c *.h
@echo off
Notes on options (see http://astyle.sourceforge.net/astyle.html for more information):
--brackets=attach, -a | |
Attach brackets to their pre-block statements (e.g. Java / K&R style). | |
--indent-switches, -S | |
Indent switch blocks so that the case X: statements are indented in the switch block. The entire case block is indented. | |
--indent=spaces, -s<#> | |
Indent using # spaces per indent | |
--recursive, -r, -R | |
For each directory in the command line, process all subdirectories recursively. | |
--suffix=none, -n | |
Do not retain a backup of the original file. The original file is purged after it is formatted. | |
--lineend=linux | |
Force use of the specified line end style. Also -z2. | |
--formatted, -Q | |
Formatted files display mode. Display only the files that have been formatted. Do not display files that are unchanged. | |
--convert-tabs, -c | |
Converts tabs into spaces in the non-indentation part of the line. |
: