aboutsummaryrefslogtreecommitdiff
path: root/contrib/uncrustify.cfg
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-09-15 10:23:55 +0200
committerChristian Grothoff <christian@grothoff.org>2019-09-15 10:24:08 +0200
commit7bfd145e5dd3ca1e7da3a1ed8f201a87f482c6ad (patch)
tree508f052d62dc1d19bf8a8aa653e6f6c300395ee9 /contrib/uncrustify.cfg
parent64ea15823b0f6245583e78f2c6ecd52cbe7de570 (diff)
downloadgnunet-7bfd145e5dd3ca1e7da3a1ed8f201a87f482c6ad.tar.gz
gnunet-7bfd145e5dd3ca1e7da3a1ed8f201a87f482c6ad.zip
use configuration from GNU Taler for uncrustify
Diffstat (limited to 'contrib/uncrustify.cfg')
-rw-r--r--contrib/uncrustify.cfg156
1 files changed, 77 insertions, 79 deletions
diff --git a/contrib/uncrustify.cfg b/contrib/uncrustify.cfg
index a5b78fb7e..6ced05d7a 100644
--- a/contrib/uncrustify.cfg
+++ b/contrib/uncrustify.cfg
@@ -1,80 +1,78 @@
1# Almost the GNU format 1input_tab_size = 2
2 2output_tab_size = 2
3indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs
4input_tab_size = 8 # original tab size
5output_tab_size = 8 # new tab size
6indent_columns = 2
7# indent_label = 2 # pos: absolute col, neg: relative column
8indent_align_string = False # align broken strings
9indent_brace = 2
10
11nl_enum_brace = remove # "enum {" vs "enum \n {"
12nl_union_brace = remove # "union {" vs "union \n {"
13nl_struct_brace = remove # "struct {" vs "struct \n {"
14nl_do_brace = add # "do {" vs "do \n {"
15nl_if_brace = add # "if () {" vs "if () \n {"
16nl_for_brace = add # "for () {" vs "for () \n {"
17nl_else_brace = add # "else {" vs "else \n {"
18nl_while_brace = add # "while () {" vs "while () \n {"
19nl_switch_brace = add # "switch () {" vs "switch () \n {"
20nl_func_var_def_blk = 1
21nl_before_case = 1
22nl_fcall_brace = add # "foo() {" vs "foo()\n{"
23nl_fdef_brace = add # "int foo() {" vs "int foo()\n{"
24# nl_after_return = TRUE
25nl_brace_while = add
26nl_brace_else = add
27nl_squeeze_ifdef = TRUE
28
29# mod_paren_on_return = ignore # "return 1;" vs "return (1);"
30# mod_full_brace_if = ignore # "if (a) a--;" vs "if (a) { a--; }"
31# mod_full_brace_for = ignore # "for () a--;" vs "for () { a--; }"
32# mod_full_brace_do = ignore # "do a--; while ();" vs "do { a--; } while ();"
33# mod_full_brace_while = ignore # "while (a) a--;" vs "while (a) { a--; }"
34
35sp_before_semi = remove
36sp_paren_paren = remove # space between (( and ))
37sp_return_paren = remove # "return (1);" vs "return(1);"
38sp_sizeof_paren = remove # "sizeof (int)" vs "sizeof(int)"
39sp_before_sparen = force # "if (" vs "if("
40sp_after_sparen = force # "if () {" vs "if (){"
41sp_after_cast = remove # "(int) a" vs "(int)a"
42sp_inside_braces = force # "{ 1 }" vs "{1}"
43sp_inside_braces_struct = force # "{ 1 }" vs "{1}"
44sp_inside_braces_enum = force # "{ 1 }" vs "{1}"
45sp_inside_paren = remove
46sp_inside_fparen = remove
47sp_inside_sparen = remove
48#sp_type_func = ignore
49sp_assign = force
50sp_arith = force
51sp_bool = force
52sp_compare = force
53sp_after_comma = force
54sp_func_def_paren = remove # "int foo (){" vs "int foo(){"
55sp_func_call_paren = remove # "foo (" vs "foo("
56sp_func_proto_paren = remove # "int foo ();" vs "int foo();"
57
58# align_with_tabs = FALSE # use tabs to align
59# align_on_tabstop = FALSE # align on tabstops
60# align_enum_equ_span = 4
61# align_nl_cont = TRUE
62# align_var_def_span = 2
63# align_var_def_inline = TRUE
64# align_var_def_star = TRUE
65# align_var_def_colon = TRUE
66# align_assign_span = 1
67# align_struct_init_span = 3
68# align_var_struct_span = 3
69# align_right_cmt_span = 3
70# align_pp_define_span = 3
71# align_pp_define_gap = 4
72# align_number_right = TRUE
73# align_typedef_span = 5
74# align_typedef_gap = 3
75
76# cmt_star_cont = TRUE
77
78eat_blanks_before_close_brace = TRUE
79eat_blanks_after_open_brace = TRUE
80 3
4indent_columns = 2
5indent_with_tabs = 0
6indent_case_brace = 2
7indent_label=0
8
9code_width=80
10#cmd_width=80
11
12# Leave most comments alone for now
13cmt_indent_multi=false
14sp_cmt_cpp_start=add
15
16sp_not=add
17
18sp_func_call_user_paren_paren=remove
19sp_inside_fparen=remove
20sp_after_cast=add
21
22ls_for_split_full=true
23ls_func_split_full=true
24ls_code_width=true
25
26# Arithmetic operations in wrapped expressions should be at the start
27# of the line.
28pos_arith=lead
29
30# Fully parenthesize boolean exprs
31mod_full_paren_if_bool=true
32
33# Braces should be on their own line
34nl_fdef_brace=add
35nl_enum_brace=add
36nl_struct_brace=add
37nl_union_brace=add
38nl_if_brace=add
39nl_brace_else=add
40nl_elseif_brace=add
41nl_while_brace=add
42nl_switch_brace=add
43
44# no newline between "else" and "if"
45nl_else_if=remove
46
47nl_func_paren=remove
48nl_assign_brace=remove
49
50# No extra newlines that cause noisy diffs
51nl_start_of_file=remove
52# If there's no new line, it's not a text file!
53nl_end_of_file=add
54
55sp_inside_paren = remove
56
57sp_arith = add
58sp_arith_additive = add
59
60# We want spaces before and after "="
61sp_before_assign = add
62sp_after_assign = add
63
64# we want "char *foo;"
65sp_after_ptr_star = remove
66sp_between_ptr_star = remove
67
68# we want "if (foo) { ... }"
69sp_before_sparen = add
70
71sp_inside_fparen = remove
72
73# add space before function call and decl: "foo (x)"
74sp_func_call_paren = add
75sp_func_proto_paren = add
76sp_func_proto_paren_empty = add
77sp_func_def_paren = add
78sp_func_def_paren_empty = add