Commit de6bc46d by triazo

Add uncrustify config for whitespace stuff

parent 99a0c7ba
Showing with 55 additions and 8 deletions
#
# Allman style
#
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs
input_tab_size = 4 # original tab size
output_tab_size = 4 # new tab size
indent_columns = output_tab_size
# brace settings
nl_assign_brace = add # "= {" vs "= \n {"
nl_enum_brace = add # "enum {" vs "enum \n {"
nl_union_brace = add # "union {" vs "union \n {"
nl_struct_brace = add # "struct {" vs "struct \n {"
nl_do_brace = add # "do {" vs "do \n {"
nl_if_brace = add # "if () {" vs "if () \n {"
nl_for_brace = add # "for () {" vs "for () \n {"
nl_else_brace = add # "else {" vs "else \n {"
nl_while_brace = add # "while () {" vs "while () \n {"
nl_switch_brace = add # "switch () {" vs "switch () \n {"
nl_fcall_brace = add # "foo() {" vs "foo()\n{"
nl_fdef_brace = add # "int foo() {" vs "int foo()\n{"
nl_brace_while = remove
nl_brace_else = add
# Spacing settings
sp_func_def_paren = remove # "int foo (){" vs "int foo(){"
sp_func_call_paren = remove # "foo (" vs "foo("
sp_func_proto_paren = remove # "int foo ();" vs "int foo();"
sp_return_paren = add # "return (1);" vs "return(1);"
sp_sizeof_paren = remove # "sizeof (int)" vs "sizeof(int)"
sp_before_sparen = force # "if (" vs "if("
# Should be obvious
sp_assign = force
sp_arith = force
sp_bool = force
sp_compare = force
sp_after_comma = force
\ No newline at end of file
Style Guidelines
----------------
Four character indentation, using spaces. Curly braces are on new
line. Spaces between operators and terms, but not next to delimiters.
Example
```C
for(i = 0; i < 1024; i++) {
do_stuff
}
For all things regarding whitespace, run code through uncrustify using
```shell
uncrustify -c style.cfg -f <source_file>
```
and refer to style.cfg for specifications.
Naming Conventions
==================
Use lowercase underscore (snake_case) for both function names and variable names.
For preprocessor constants defines, use all uppercase letters, with
underscores between words.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment