uncrustify.cfg 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. input_tab_size = 2
  2. output_tab_size = 2
  3. indent_columns = 2
  4. indent_with_tabs = 0
  5. indent_case_brace = 2
  6. indent_label=-16
  7. code_width=80
  8. #cmd_width=80
  9. # Leave most comments alone for now
  10. cmt_indent_multi=false
  11. sp_cmt_cpp_start=add
  12. sp_not=add
  13. sp_func_call_user_paren_paren=remove
  14. sp_inside_fparen=remove
  15. sp_after_cast=add
  16. ls_for_split_full=true
  17. ls_func_split_full=true
  18. ls_code_width=true
  19. # Arithmetic operations in wrapped expressions should be at the start
  20. # of the line.
  21. pos_arith=lead
  22. # Fully parenthesize boolean exprs
  23. mod_full_paren_if_bool=true
  24. # Braces should be on their own line
  25. nl_fdef_brace=add
  26. nl_enum_brace=add
  27. nl_struct_brace=add
  28. nl_union_brace=add
  29. nl_if_brace=add
  30. nl_brace_else=add
  31. nl_elseif_brace=add
  32. nl_while_brace=add
  33. nl_switch_brace=add
  34. # no newline between "else" and "if"
  35. nl_else_if=remove
  36. nl_func_paren=remove
  37. nl_assign_brace=remove
  38. # No extra newlines that cause noisy diffs
  39. nl_start_of_file=remove
  40. nl_after_func_proto = 2
  41. nl_after_func_body = 3
  42. # If there's no new line, it's not a text file!
  43. nl_end_of_file=add
  44. nl_max_blank_in_func = 3
  45. nl_max = 3
  46. sp_inside_paren = remove
  47. sp_arith = add
  48. sp_arith_additive = add
  49. # We want spaces before and after "="
  50. sp_before_assign = add
  51. sp_after_assign = add
  52. # we want "char *foo;"
  53. sp_before_ptr_star = add
  54. sp_after_ptr_star = remove
  55. sp_between_ptr_star = remove
  56. # we want "if (foo) { ... }"
  57. sp_before_sparen = add
  58. sp_inside_fparen = remove
  59. sp_inside_sparen = remove
  60. # Add or remove space around compare operator '<', '>', '==', etc
  61. sp_compare = add # ignore/add/remove/force
  62. # add space before function call and decl: "foo (x)"
  63. sp_func_call_paren = add
  64. sp_func_proto_paren = add
  65. sp_func_proto_paren_empty = add
  66. sp_func_def_paren = add
  67. sp_func_def_paren_empty = add
  68. # We'd want it for "if ( (foo) || (bar) )", but not for "if (m())",
  69. # so as uncrustify doesn't give exactly what we want => ignore
  70. sp_paren_paren = ignore
  71. sp_inside_paren = remove
  72. sp_bool = force
  73. nl_func_type_name = force
  74. #nl_branch_else = add
  75. nl_else_brace = add
  76. nl_elseif_brace = add
  77. nl_for_brace = add
  78. # Whether to ignore the '#define' body while formatting.
  79. pp_ignore_define_body = true # true/false
  80. # Add or remove space between #else or #endif and a trailing comment.
  81. sp_endif_cmt = add # ignore/add/remove/force
  82. # The span for aligning comments that end lines.
  83. #
  84. # 0: Don't align (default).
  85. align_right_cmt_span = 3 # unsigned number
  86. # Minimum number of columns between preceding text and a trailing comment in
  87. # order for the comment to qualify for being aligned. Must be non-zero to have
  88. # an effect.
  89. align_right_cmt_gap = 2 # unsigned number