Changes between Version 11 and Version 12 of CodeStyle
- Timestamp:
- 12/08/16 22:35:03 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CodeStyle
v11 v12 86 86 This makes the intent immediately clear to the reader / reviewer. 87 87 88 = GNU Indent rules = 89 to get the above effect, use 90 {{{ 91 gindent -kr -bl -nce -nbc -l80 file.c 92 }}} 93 (though other options might be needed, work in progress) 94 95 Indent likes to produce artifacts, though, because it really really likes putting the return type on the same line as the function name, which creates long and messy declarations for many functions in tun.c (my test candidate). 96 97 A slightly less brutal tool (because it can be told to just leave certain constructs alone, while changing others) seems to be 88 = Crustify rules = 89 The most fit tool for our purpose (because it can be told to just leave certain constructs alone, while changing others) seems to be 98 90 99 91 {{{ … … 101 93 }}} 102 94 103 ... but that one has a zillion of options (600)... some options for a start95 ... but it has a zillion of options (600)... our config-in-the-making: 104 96 {{{ 97 # Use Allman-style, space-only 105 98 indent_columns=4 106 indent_with_tabs=2 99 indent_with_tabs=0 100 align_with_tabs=false 107 101 indent_braces=false 108 102 indent_else_if=false 109 indent_switch_case=2110 indent_label=-2111 sp_before_sparen=add112 sp_inside_sparen=remove113 103 nl_if_brace=add 114 104 nl_brace_else=add … … 116 106 nl_else_brace=add 117 107 nl_else_if=remove 108 sp_func_proto_paren=Remove 109 sp_func_def_paren=Remove 110 sp_func_call_paren=Remove 111 112 # Do not put spaces between the # and preprocessor statements 113 pp_space=remove 114 115 cmt_convert_tab_to_spaces=true 116 indent_switch_case=4 117 indent_label=1 118 sp_before_sparen=add 119 sp_inside_sparen=remove 120 sp_cond_colon=add 121 sp_cond_question=add 122 sp_bool=add 123 sp_else_brace=add 124 sp_brace_else=add 125 pos_arith=Lead 118 126 nl_func_type_name=add 127 nl_before_case=true 128 nl_assign_leave_one_liners=true 129 nl_enum_leave_one_liners=true 130 nl_brace_fparen=add 131 nl_max=4 132 nl_after_func_proto=2 119 133 code_width=80 134 ls_code_width=false 120 135 mod_full_brace_if=add 121 136 mod_full_brace_if_chain=false 122 137 mod_add_long_ifdef_endif_comment=20 123 mod_add_long_ifdef_else_comment 138 mod_add_long_ifdef_else_comment=5 139 mod_remove_extra_semicolon=true 124 140 cmt_c_nl_end=true 125 141 cmt_star_cont=true 126 pp_indent=add 142 143 # Use "char **a"-style pointer stars 144 sp_before_ptr_star=Add 145 sp_between_ptr_star=Remove 146 sp_after_ptr_star=Remove 147 127 148 }}}