uncrustify.cfg 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. # -------------------------------------------------------------------------------------------------#
  2. # #
  3. # _ _ _ _ __ ___ _____ _ _ __ _ #
  4. # | | | |_ _ __ _ _ _ _ __| |_(_)/ _|_ _ / __| / / __|| |_ _| |_ __ ___ _ _ / _(_)__ _ #
  5. # | |_| | ' \/ _| '_| || (_-< _| | _| || | | (__ / / (_|_ _|_ _| / _/ _ \ ' \| _| / _` | #
  6. # \___/|_||_\__|_| \_,_/__/\__|_|_| \_, | \___/_/ \___||_| |_| \__\___/_||_|_| |_\__, | #
  7. # |__/ |___/ #
  8. # #
  9. # -------------------------------------------------------------------------------------------------#
  10. # #
  11. # Style: rindeal #
  12. # #
  13. # -------------------------------------------------------------------------------------------------#
  14. # Boilerplate: https://github.com/bengardner/uncrustify/blob/master/etc/defaults.cfg #
  15. # -------------------------------------------------------------------------------------------------#
  16. ## General
  17. ## -------------------------------------------------------------------------------------------------
  18. # The type of line endings
  19. newlines = lf # auto/lf/crlf/cr
  20. # - 80 limit is completely deprecated
  21. # - 100 is the new soft limit
  22. # - 120 is hard limit
  23. code_width = 120
  24. # empty_lines_max = nl_max - 1
  25. nl_max = 3
  26. ## UNICODE
  27. ## -------------------------------------------------------------------------------------------------
  28. ## Ideally ASCII, UTF-8 otherwise
  29. # If the file contains bytes with values between 128 and 255, but is not UTF-8, then output as UTF-8
  30. utf8_byte = false
  31. # Force the output encoding to UTF-8
  32. utf8_force = true
  33. ## Tabs
  34. ## -------------------------------------------------------------------------------------------------
  35. ## Always use 4 spaces
  36. input_tab_size = 4
  37. output_tab_size = 4
  38. indent_with_tabs = 0
  39. # Comments that are not a brace level are indented with tabs on a tabstop.
  40. # Requires indent_with_tabs = 2. If false, will use spaces.
  41. indent_cmt_with_tabs = false
  42. # Whether to use tabs for aligning
  43. align_with_tabs = false
  44. # Whether to keep non-indenting tabs
  45. align_keep_tabs = false
  46. # Whether to bump out to the next tab when aligning
  47. align_on_tabstop = false
  48. ## Indenting
  49. ## -------------------------------------------------------------------------------------------------
  50. # The number of columns to indent per level.
  51. # Usually 2, 3, 4, or 8.
  52. indent_columns = 4
  53. # The continuation indent. If non-zero, this overrides the indent of '(' and '=' continuation indents.
  54. # For FreeBSD, this is set to 4. Negative value is absolute and not increased for each ( level
  55. indent_continue = 2
  56. ## Spacing
  57. ## -------------------------------------------------------------------------------------------------
  58. # Whether to balance spaces inside nested parens
  59. sp_balance_nested_parens = false
  60. ## Parentheses
  61. ## -------------------------------------------------------------------------------------------------
  62. # Controls the indent of a close paren after a newline.
  63. # 0: Indent to body level
  64. # 1: Align under the open paren
  65. # 2: Indent to the brace level
  66. indent_paren_close = 2
  67. ## Preprocessor
  68. ## -------------------------------------------------------------------------------------------------
  69. # Control indent of preprocessors inside #if blocks at brace level 0
  70. pp_indent = remove # ignore/add/remove/force
  71. # indent by 1 space
  72. pp_space = add
  73. pp_space_count = 1
  74. # indent pp at code level
  75. pp_indent_at_level = true
  76. pp_define_at_level = true
  77. # Control whether to indent the code between #if, #else and #endif when not at file-level
  78. pp_if_indent_code = false
  79. # # Align macro functions and variables together
  80. align_pp_define_together = false
  81. # The minimum space between label and value of a preprocessor define
  82. align_pp_define_gap = 1
  83. # The span for aligning on '#define' bodies (0=don't align)
  84. align_pp_define_span = 2
  85. # Add or remove space around preprocessor '##' concatenation operator. Default=Add
  86. sp_pp_concat = add # ignore/add/remove/force
  87. # Add or remove space after preprocessor '#' stringify operator. Also affects the '#@' charizing operator.
  88. sp_pp_stringify = ignore # ignore/add/remove/force
  89. # Add or remove space before preprocessor '#' stringify operator as in '#define x(y) L#y'.
  90. sp_before_pp_stringify = ignore # ignore/add/remove/force
  91. # Template
  92. # --------------------------------------------------------------------------------------------------
  93. # Add or remove space in 'template <' vs 'template<'.
  94. # If set to ignore, sp_before_angle is used.
  95. sp_template_angle = add # ignore/add/remove/force
  96. # Add or remove space before '<>'
  97. sp_before_angle = remove # ignore/add/remove/force
  98. # Add or remove space inside '<' and '>'
  99. sp_inside_angle = remove # ignore/add/remove/force
  100. # Add or remove space after '<>'
  101. sp_after_angle = add # ignore/add/remove/force
  102. # Add or remove space between '<>' and '(' as found in 'new List<byte>();'
  103. sp_angle_paren = remove # ignore/add/remove/force
  104. # Add or remove space between '<>' and a word as in 'List<byte> m;'
  105. sp_angle_word = add # ignore/add/remove/force
  106. # Add or remove space between '>' and '>' in '>>' (template stuff C++/C# only). Default=Add
  107. sp_angle_shift = add # ignore/add/remove/force
  108. indent_align_string = false
  109. # Whether braces are indented to the body level
  110. indent_braces = false
  111. # Disabled indenting function braces if indent_braces is true
  112. indent_braces_no_func = false
  113. # Disabled indenting class braces if indent_braces is true
  114. indent_braces_no_class = false
  115. # Disabled indenting struct braces if indent_braces is true
  116. indent_braces_no_struct = false
  117. # Indent based on the size of the brace parent, i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc.
  118. indent_brace_parent = false
  119. indent_namespace = false
  120. indent_extern = false
  121. indent_class = true
  122. indent_class_colon = false
  123. indent_else_if = false
  124. indent_var_def_cont = true
  125. indent_func_call_param = false
  126. indent_func_def_param = false
  127. indent_func_proto_param = false
  128. indent_func_class_param = false
  129. indent_func_ctor_var_param = false
  130. indent_func_param_double = true
  131. indent_template_param = false
  132. indent_relative_single_line_comments = false
  133. indent_col1_comment = true
  134. indent_access_spec_body = false
  135. indent_paren_nl = false
  136. indent_comma_paren = false
  137. indent_bool_paren = false
  138. indent_first_bool_expr = false
  139. indent_square_nl = false
  140. indent_preserve_sql = false
  141. indent_align_assign = true
  142. align_number_left = true
  143. align_func_params = true
  144. align_same_func_call_params = false
  145. align_var_def_colon = false
  146. align_var_def_attribute = true
  147. align_var_def_inline = true
  148. align_right_cmt_mix = false
  149. align_on_operator = false
  150. align_mix_var_proto = false
  151. align_single_line_func = false
  152. align_single_line_brace = false
  153. align_nl_cont = false
  154. align_left_shift = true
  155. align_oc_decl_colon = false
  156. nl_collapse_empty_body = true
  157. nl_assign_leave_one_liners = true
  158. nl_class_leave_one_liners = true
  159. nl_enum_leave_one_liners = true
  160. nl_getset_leave_one_liners = true
  161. nl_func_leave_one_liners = true
  162. nl_if_leave_one_liners = true
  163. nl_multi_line_cond = true
  164. nl_multi_line_define = true
  165. nl_before_case = false
  166. nl_after_case = false
  167. nl_after_return = true
  168. nl_after_semicolon = true
  169. nl_after_brace_open = false
  170. nl_after_brace_open_cmt = false
  171. nl_after_vbrace_open = false
  172. nl_after_vbrace_open_empty = false
  173. nl_after_brace_close = false
  174. nl_after_vbrace_close = false
  175. nl_define_macro = false
  176. nl_squeeze_ifdef = false
  177. nl_ds_struct_enum_cmt = false
  178. nl_ds_struct_enum_close_brace = false
  179. nl_create_if_one_liner = false
  180. nl_create_for_one_liner = false
  181. nl_create_while_one_liner = false
  182. ls_for_split_full = true
  183. ls_func_split_full = false
  184. nl_after_multiline_comment = true
  185. eat_blanks_after_open_brace = true
  186. eat_blanks_before_close_brace = true
  187. mod_pawn_semicolon = false
  188. mod_full_paren_if_bool = false
  189. mod_remove_extra_semicolon = false
  190. mod_sort_import = false
  191. mod_sort_using = false
  192. mod_sort_include = false
  193. mod_move_case_break = false
  194. mod_remove_empty_return = true
  195. cmt_indent_multi = true
  196. cmt_c_group = false
  197. cmt_c_nl_start = false
  198. cmt_c_nl_end = false
  199. cmt_cpp_group = false
  200. cmt_cpp_nl_start = false
  201. cmt_cpp_nl_end = false
  202. cmt_cpp_to_c = false
  203. cmt_star_cont = true
  204. cmt_multi_check_last = true
  205. cmt_insert_before_preproc = false
  206. indent_sing_line_comments = 0
  207. indent_switch_case = 4
  208. indent_case_shift = 0
  209. align_var_def_star_style = 0
  210. align_var_def_amp_style = 1
  211. align_assign_span = 1
  212. align_assign_thresh = 8
  213. align_enum_equ_span = 3
  214. align_var_struct_span = 3
  215. align_var_struct_gap = 1
  216. align_struct_init_span = 2
  217. align_right_cmt_span = 2
  218. align_right_cmt_gap = 1
  219. align_right_cmt_at_col = 2
  220. nl_end_of_file_min = 1
  221. nl_func_var_def_blk = 1
  222. nl_after_func_body = 2
  223. nl_after_func_body_one_liner = 2
  224. nl_before_block_comment = 2
  225. nl_after_struct = 1
  226. mod_full_brace_nl = 1
  227. mod_add_long_function_closebrace_comment = 32
  228. mod_add_long_ifdef_endif_comment = 10
  229. mod_add_long_ifdef_else_comment = 10
  230. sp_arith = force
  231. sp_assign = force
  232. sp_assign_default = add
  233. sp_enum_assign = force
  234. sp_bool = force
  235. sp_compare = force
  236. sp_before_ptr_star = add
  237. sp_before_unnamed_ptr_star = add
  238. sp_between_ptr_star = remove
  239. sp_after_ptr_star = remove
  240. sp_after_ptr_star_func = force
  241. sp_before_ptr_star_func = force
  242. sp_after_type = force
  243. sp_before_sparen = force
  244. sp_inside_sparen = remove
  245. sp_after_sparen = add
  246. sp_sparen_brace = add
  247. sp_special_semi = remove
  248. sp_before_semi = remove
  249. sp_before_semi_for_empty = remove
  250. sp_after_semi = add
  251. sp_after_semi_for_empty = remove
  252. sp_after_comma = force
  253. sp_before_comma = remove
  254. sp_before_case_colon = remove
  255. sp_after_operator = add
  256. sp_after_operator_sym = add
  257. sp_after_cast = add
  258. sp_inside_paren_cast = remove
  259. sp_sizeof_paren = remove
  260. sp_inside_braces_enum = add
  261. sp_inside_braces_struct = add
  262. sp_inside_braces = add
  263. sp_inside_braces_empty = add
  264. sp_func_proto_paren = remove
  265. sp_func_def_paren = remove
  266. sp_inside_fparens = remove
  267. sp_inside_fparen = remove
  268. sp_fparen_brace = force
  269. sp_func_call_paren = remove
  270. sp_func_call_paren_empty = remove
  271. sp_func_call_user_paren = remove
  272. sp_return_paren = add
  273. sp_attribute_paren = remove
  274. sp_defined_paren = remove
  275. sp_macro = ignore
  276. sp_macro_func = ignore
  277. sp_else_brace = add
  278. sp_brace_else = add
  279. sp_brace_typedef = add
  280. sp_not = remove
  281. sp_inv = remove
  282. sp_addr = remove
  283. sp_member = remove
  284. sp_deref = remove
  285. sp_sign = remove
  286. sp_incdec = remove
  287. sp_before_nl_cont = add
  288. sp_cond_colon = force
  289. sp_cond_question = force
  290. sp_cmt_cpp_start = add
  291. nl_start_of_file = remove
  292. nl_end_of_file = force
  293. nl_assign_brace = remove
  294. nl_assign_square = remove
  295. nl_enum_brace = remove
  296. nl_struct_brace = remove
  297. nl_union_brace = remove
  298. nl_if_brace = remove
  299. nl_brace_else = remove
  300. nl_elseif_brace = remove
  301. nl_else_brace = remove
  302. nl_else_if = remove
  303. nl_for_brace = remove
  304. nl_while_brace = remove
  305. nl_do_brace = remove
  306. nl_brace_while = remove
  307. nl_switch_brace = remove
  308. nl_case_colon_brace = remove
  309. nl_func_type_name = remove
  310. nl_func_proto_type_name = add
  311. nl_func_paren = remove
  312. nl_func_def_paren = remove
  313. nl_func_decl_empty = remove
  314. nl_func_def_empty = remove
  315. nl_fdef_brace = remove
  316. nl_return_expr = remove
  317. pos_arith = lead
  318. pos_assign = trail
  319. pos_bool = trail
  320. pos_conditional = trail
  321. pos_comma = trail
  322. pos_class_comma = lead
  323. pos_class_colon = lead
  324. mod_full_brace_do = remove
  325. mod_full_brace_for = remove
  326. mod_full_brace_function = force
  327. mod_full_brace_while = remove
  328. mod_paren_on_return = ignore
  329. mod_full_brace_if = add
  330. # Misc
  331. # --------------------------------------------------------------------------------------------------
  332. # Allow interpreting '>=' and '>>=' as part of a template in 'void f(list<list<B>>=val);'.
  333. # If true (default), 'assert(x<0 && y>=3)' will be broken.
  334. # Improvements to template detection may make this option obsolete.
  335. tok_split_gte = false