doom3-bfg/neo/astyle-options.ini
2020-03-27 18:59:11 +01:00

117 lines
2.2 KiB
INI

# Quotation from Rust Style Guide:
# "Formatting code is a mostly mechanical task which takes both time and mental effort.
# By using an automatic formatting tool, a programmer is relieved of this task and can concentrate on more important things.
# Furthermore, by sticking to an established style guide (such as this one),
# programmers don't need to formulate ad hoc style rules,
# nor do they need to debate with other programmers what style rules should be used, saving time, communication overhead, and mental energy."
# C++ Microsoft style
--style=ansi
#int Foo(bool isBar)
#{
# if (isBar)
# {
# bar();
# return 1;
# }
# else
# return 0;
#}
# Don't waste time typing lots of empty space and use tabs
--indent=tab=4
--indent=force-tab=4
# Indent macros within multiple level hierarchies
--indent-preproc-block
#ifdef _WIN32
#include <windows.h>
#ifndef NO_EXPORT
#define EXPORT
#endif
#endif
#becomes:
#ifdef _WIN32
#include <windows.h>
#ifndef NO_EXPORT
#define EXPORT
#endif
#endif
--indent-switches
#switch (foo)
#{
# case 1:
# a += 1;
# break;
#
# case 2:
# {
# a += 2;
# break;
# }
#}
# Fill empty lines with the white space of the previous line
#--fill-empty-lines
# Insert space padding around operators. This will also pad commas.
--pad-oper
#if (foo==2)
# a=bar((b-c)*a,d--);
#becomes:
#if (foo == 2)
# a = bar((b - c) * a, d--);
# Uncommon but introduced by id Software and I really like it:
# Insert space padding around paren on the inside only.
#if ( isFoo( a, b ) )
# bar( a, b );
--pad-paren-in
# Remove extra space padding around parens on the outside.
#if ( isFoo( a, b ) )
# bar ( a, b );
#becomes (with no padding option requested):
#if(isFoo(a, b))
# bar(a, b);
--unpad-paren
# Attach a pointer or reference operator (*, &, or ^) to the variable type
#char *foo1;
#char &foo2;
#becomes (with align-pointer=type):
#char* foo1;
#char& foo2;
--align-pointer=type
--align-reference=type
# Add braces to unbraced one line conditional statements (e.g. 'if', 'for', 'while'...).
#if (isFoo)
# isFoo = false;
#becomes:
#if (isFoo) {
# isFoo = false;
#}
--add-brackets
# no .orig Backups
--suffix=none