uncrustify.cfg 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. # tools/uncrustify.cfg
  2. #
  3. # uncrustify config file for NuttX
  4. #
  5. indent_with_tabs = 0 # 0=spaces only; 1=indent to level only; 2=indent with tabs
  6. input_tab_size = 4 # original tab size
  7. output_tab_size = 4 # new tab size
  8. indent_columns = 2 # Two columns per indent level
  9. indent_label = 1 # pos: absolute col, neg: relative column
  10. code_width = 78 # Try to limit code width to N number of columns
  11. #
  12. # Newlines
  13. #
  14. nl_max = 2 # No more than \n\n
  15. nl_after_semicolon = true # Make sure there is only one statement per line
  16. nl_after_brace_open = true # Add \n after brace open and before the matching brace close.
  17. nl_if_leave_one_liners = false # Split one-line if/else statements
  18. sp_after_semi = remove # Remove space after ';', except when followed by a comment.
  19. sp_after_semi_for_empty = force # Force one space after the final semicolon of an empty part of a for statement.
  20. sp_before_square = remove # Remove space before '[' (except '[]').
  21. nl_after_label_colon = true # Force a newline after a label's colon.
  22. nl_after_func_proto = 1 # One \n after function prototype
  23. nl_after_func_proto_group = 2 # Two \n after last prototype
  24. nl_after_func_body = 2 # was 1. One \n after function body
  25. nl_after_func_body_class = 1 # One \n after '}' of a single line function body
  26. nl_after_multiline_comment = true # Newline after multiline comment
  27. nl_before_block_comment = 2 # Two \n before block comment
  28. nl_before_c_comment = 2 # was 1. At least line space before C comment
  29. nl_before_cpp_comment = 1 #At least line space before C++ comment
  30. nl_after_multiline_comment = true # Force newline after mult-line comment
  31. nl_after_struct = 2 # Two \n after struct
  32. nl_after_class = 2 # Two \n after class
  33. nl_before_access_spec = 2 # Two \n before 'private:', 'public:', ...
  34. nl_after_access_spec = 1 # One \n after 'private:', 'public:', ...
  35. nl_comment_func_def = 2 # Two \n between function def and function comment.
  36. nl_after_try_catch_finally = 2 # Two \n after a try-catch-finally block
  37. nl_around_cs_property = 0 # No change in number of newlines before/after a property, indexer or event decl.
  38. eat_blanks_after_open_brace = false # May be a comment. Remove blank lines after '{'
  39. eat_blanks_before_close_brace = false # May be a comment. Remove blank lines after '}'
  40. nl_remove_extra_newlines = 1 # was 2. Remove all newlines not specified by config
  41. nl_before_return = false # No newline before return
  42. nl_after_return = false # No newline after return statement`
  43. nl_enum_brace = add # "enum \n { vs enum {"
  44. nl_union_brace = add # "union \n {" vs "union {"
  45. nl_struct_brace = add # "struct \n {" vs "struct {"
  46. nl_do_brace = add # "do \n {" vs "do {"
  47. nl_if_brace = add # "if \n () {" vs "if () {"
  48. nl_for_brace = add # "for \n () {" vs "for () {"
  49. nl_else_brace = add # "else \n {" vs "else {"
  50. nl_while_brace = add # "while \n () {" vs "while () {"
  51. nl_switch_brace = add # "switch \n () {" vs "switch () {"
  52. nl_brace_while = add # "} \n while" vs "} while"
  53. nl_brace_else = add # "} \n else" vs "} else"
  54. nl_func_var_def_blk = 1
  55. nl_fcall_brace = add # "list_for_each() \n {" vs "list_for_each() {"
  56. nl_fdef_brace = add # "int foo() {" vs "int foo()\n{"
  57. nl_before_case = true # Newline before 'case' statement
  58. #
  59. # Source code modifications
  60. #
  61. mod_full_brace_do = add # "do { a--; } while ();" vs "do a--; while ();"
  62. mod_full_brace_for = add # "for () { a--; }" vs "for () a--;"
  63. mod_full_brace_function = add # Add braces on single-line function definitions. (Pawn)
  64. mod_full_brace_if = add # "if (a) { a--; }" vs "if (a) a--;"
  65. mod_full_brace_if_chain = false # was true Make all if/elseif/else statements in a chain be braced
  66. mod_full_brace_nl = 1 # Don't remove if more than 1 newlines
  67. mod_full_brace_while = add # "while (a) { a--; } " vs "while (a) a--;"
  68. mod_full_brace_using = add # Add braces on single-line 'using ()' statement
  69. mod_paren_on_return = remove # "return 1;" vs "return (1);"
  70. mod_pawn_semicolon = true # Change optional semicolons to real semicolons
  71. mod_full_paren_if_bool = false # Don't add parens on 'while' and 'if' statement around bools
  72. mod_remove_extra_semicolon = true # Remove superfluous semicolons
  73. # mod_add_long_function_closebrace_comment
  74. # mod_add_long_namespace_closebrace_comment
  75. # mod_add_long_switch_closebrace_comment
  76. # mod_add_long_ifdef_endif_comment
  77. # mod_add_long_ifdef_else_comment
  78. mod_move_case_break = false # Don't break into braced 'case'
  79. mod_case_brace = add # Add braces around acase statements.
  80. mod_remove_empty_return = true # Remove a void 'return;' that appears as the last statement in a function.
  81. #
  82. # Comment modifications
  83. #
  84. cmt_width = 78 # Wrap comments at line 78
  85. # cmt_reflow_mode # No reflowing
  86. # cmt_convert_tab_to_spaces # Tabs retained in comments
  87. # cmt_indent_multi # Don't disable multi-line comment changes
  88. cmt_c_group = true # Group C comments that look like they are in a block
  89. cmt_c_nl_start = true # No empty '/*' on the first line of the combined c-comment
  90. cmt_c_nl_end = true # Add newline before the closing '*/' of the combined c-comment
  91. cmt_cpp_group = true # Group C++ comments that look like they are in a block
  92. cmt_cpp_nl_start = false # No '/*' on the first line of the combined cpp-comment
  93. cmt_cpp_nl_end = true # Add newline before the closing '*/' of the combined C++ comment
  94. cmt_cpp_to_c = true # Change C++ comments to C comments
  95. cmt_star_cont = true # Add star to comment continuation
  96. cmt_sp_before_star_cont = 0 # was 1. One space before star on subsequent comment lines
  97. # The value 1 added an extra space, indenting by 2.
  98. cmt_sp_after_star_cont = 1 # One space after star on subsequent comment lines
  99. cmt_multi_check_last = true # Multi-line comments with a '*' lead, remove leading spaces
  100. # cmt_insert_file_header # filename containing the file header
  101. # cmt_insert_file_footer # filename containing the file footer
  102. # cmt_insert_func_header # filename containing the function header
  103. # cmt_insert_class_header # filename containing the class header
  104. # cmt_insert_before_preproc # ?
  105. #
  106. # inter-character spacing options
  107. #
  108. sp_return_paren = force # "return (1);" vs "return(1);"
  109. sp_sizeof_paren = remove # "sizeof (int)" vs "sizeof(int)"
  110. sp_before_sparen = force # "if (" vs "if("
  111. sp_after_sparen = remove # "if () {" vs "if (){"
  112. sp_after_cast = remove # "(int) a" vs "(int)a"
  113. sp_inside_braces = add # "{ 1 }" vs "{1}"
  114. sp_inside_braces_struct = add # "{ 1 }" vs "{1}"
  115. sp_inside_braces_enum = add # "{ 1 }" vs "{1}"
  116. sp_assign = add # "{ 1 }" vs "{1}"
  117. sp_arith = add # Add spaces around assignment operators
  118. sp_bool = add # Add spaces around boolean operators
  119. sp_compare = add # Add spaces around comparison operators
  120. sp_after_comma = add # Add space after comma
  121. sp_func_def_paren = remove # "int foo (){" vs "int foo(){"
  122. sp_func_call_paren = remove # "foo (" vs "foo("
  123. sp_func_proto_paren = remove # "int foo ();" vs "int foo();"
  124. #
  125. # Aligning stuff
  126. #
  127. align_with_tabs = false # Use spaces to align
  128. align_on_tabstop = true # align on tabstops
  129. align_keep_tabs = false # Don't keep non-indenting tabs
  130. align_enum_equ_span = 2 # '=' in enum definition
  131. align_nl_cont = true # Align macros wrapped wht \n
  132. align_var_def_span = 2 # Span for aligning varialbe definitions
  133. align_var_def_inline = true # Align union/struct variable definitions
  134. align_var_def_star_style = 2 # 2=Dangling
  135. align_var_def_colon = true # Align colons in bit field definitions
  136. align_assign_span = 1 # Span for aligning =
  137. align_struct_init_span = 3 # align stuff in a structure init '= { }'
  138. align_right_cmt_span = 3 # Span for aligning comments that end lines
  139. align_pp_define_span = 8 # Span for aligning #define bodies
  140. align_pp_define_gap = 2 # Min space define #define variable and value
  141. indent_brace = 2 # Indent brace 2 from level