|
| 1 | +# |
| 2 | +# based on uncrustify config file for the linux kernel |
| 3 | +# |
| 4 | + |
| 5 | +code_width = 80 |
| 6 | +indent_case_brace = 4 |
| 7 | +indent_columns = 4 |
| 8 | +indent_label = 2 # pos: absolute col, neg: relative column |
| 9 | +indent_with_tabs = 0 |
| 10 | + |
| 11 | +# |
| 12 | +# inter-symbol newlines |
| 13 | +# |
| 14 | +nl_brace_else = remove # "} else" vs "} \n else" - cuddle else |
| 15 | +nl_brace_while = remove # "} while" vs "} \n while" - cuddle while |
| 16 | +nl_do_brace = remove # "do {" vs "do \n {" |
| 17 | +nl_else_brace = remove # "else {" vs "else \n {" |
| 18 | +nl_enum_brace = remove # "enum {" vs "enum \n {" |
| 19 | +nl_fcall_brace = remove # "list_for_each() {" vs "list_for_each()\n{" |
| 20 | +nl_fdef_brace = force # "int foo() {" vs "int foo()\n{" |
| 21 | +nl_for_brace = remove # "for () {" vs "for () \n {" |
| 22 | +nl_func_var_def_blk = 0 # don't add newlines after a block of var declarations |
| 23 | +nl_if_brace = remove # "if () {" vs "if () \n {" |
| 24 | +nl_multi_line_define = true |
| 25 | +nl_struct_brace = remove # "struct {" vs "struct \n {" |
| 26 | +nl_switch_brace = remove # "switch () {" vs "switch () \n {" |
| 27 | +nl_union_brace = remove # "union {" vs "union \n {" |
| 28 | +nl_while_brace = remove # "while () {" vs "while () \n {" |
| 29 | + |
| 30 | + |
| 31 | +# |
| 32 | +# Source code modifications |
| 33 | +# |
| 34 | +mod_full_brace_do = force # "do a--; while ();" vs "do { a--; } while ();" |
| 35 | +mod_full_brace_for = force # "for () a--;" vs "for () { a--; }" |
| 36 | +mod_full_brace_if = force # "if (a) a--;" vs "if (a) { a--; }" |
| 37 | +mod_full_brace_nl = 3 # don't remove if more than 3 newlines |
| 38 | +mod_full_brace_while = force # "while (a) a--;" vs "while (a) { a--; }" |
| 39 | +mod_paren_on_return = remove # "return 1;" vs "return (1);" |
| 40 | + |
| 41 | + |
| 42 | +# |
| 43 | +# inter-character spacing options |
| 44 | +# |
| 45 | +sp_after_cast = remove # "(int) a" vs "(int)a" |
| 46 | +sp_after_comma = force |
| 47 | +sp_after_sparen = force # "if () {" vs "if (){" |
| 48 | +sp_arith = force |
| 49 | +sp_assign = force |
| 50 | +sp_assign = force |
| 51 | +sp_before_comma = remove |
| 52 | +sp_before_ptr_star = force # "char *foo" vs "char* foo |
| 53 | +sp_before_sparen = force # "if (" vs "if(" |
| 54 | +sp_between_ptr_star = remove # "char * *foo" vs "char **foo" |
| 55 | +sp_bool = force |
| 56 | +sp_compare = force |
| 57 | +sp_func_call_paren = remove # "foo (" vs "foo(" |
| 58 | +sp_func_def_paren = remove # "int foo (){" vs "int foo(){" |
| 59 | +sp_func_proto_paren = remove # "int foo ();" vs "int foo();" |
| 60 | +sp_inside_braces = force # "{ 1 }" vs "{1}" |
| 61 | +sp_inside_braces_enum = force # "{ 1 }" vs "{1}" |
| 62 | +sp_inside_braces_struct = force # "{ 1 }" vs "{1}" |
| 63 | +sp_inside_sparen = remove |
| 64 | +sp_paren_brace = force |
| 65 | +sp_sizeof_paren = remove # "sizeof (int)" vs "sizeof(int)" |
| 66 | + |
| 67 | +# |
| 68 | +# Aligning stuff |
| 69 | +# |
| 70 | +align_enum_equ_span = 4 # '=' in enum definition |
| 71 | +align_nl_cont = true |
| 72 | +align_on_tabstop = FALSE # align on tabstops |
| 73 | +align_right_cmt_span = 3 |
| 74 | +align_struct_init_span = 1 |
| 75 | +align_struct_init_span = 3 # align stuff in a structure init '= { }' |
| 76 | +align_var_def_star_style = 2 # void *foo; |
| 77 | +align_var_struct_span = 0 |
| 78 | +align_with_tabs = FALSE # use tabs to align |
0 commit comments