From 9858b3c98208903e148dd696aca52a3bdd72976b Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Wed, 28 Feb 2018 11:06:13 -0800 Subject: [PATCH 1/2] update uncrustify config to version 0.66.1 --- .../configuration/ament_code_style.cfg | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/ament_uncrustify/ament_uncrustify/configuration/ament_code_style.cfg b/ament_uncrustify/ament_uncrustify/configuration/ament_code_style.cfg index 87fbed46..e074e69e 100644 --- a/ament_uncrustify/ament_uncrustify/configuration/ament_code_style.cfg +++ b/ament_uncrustify/ament_uncrustify/configuration/ament_code_style.cfg @@ -1,4 +1,4 @@ -# Uncrustify_d-0.65-225-ff0808b +# Uncrustify-0.66.1-28-788c5ce # # General options @@ -53,6 +53,9 @@ utf8_force = false # false/true # also '>>>' '<<' '>>' '%' '|'. sp_arith = force # ignore/add/remove/force +# Add or remove space around arithmetic operator '+' and '-'. Overrides sp_arith +sp_arith_additive = force # ignore/add/remove/force + # Add or remove space around assignment operator '=', '+=', etc. sp_assign = force # ignore/add/remove/force @@ -173,6 +176,9 @@ sp_before_angle = remove # ignore/add/remove/force # Add or remove space inside '<' and '>'. sp_inside_angle = remove # ignore/add/remove/force +# Add or remove space between '<>' and ':'. +sp_angle_colon = ignore # ignore/add/remove/force + # Add or remove space after '<>'. sp_after_angle = remove # ignore/add/remove/force @@ -288,9 +294,7 @@ sp_after_operator = remove # ignore/add/remove/force # Add or remove space between the operator symbol and the open paren, as in 'operator ++('. sp_after_operator_sym = remove # ignore/add/remove/force -# Add or remove space between the operator symbol and the open paren when the operator -# has no arguments, as in 'operator *()'. -# Have precedence of sp_after_operator_sym. +# Overrides sp_after_operator_sym when the operator has no arguments, as in 'operator *()'. sp_after_operator_sym_empty = remove # ignore/add/remove/force # Add or remove space after C/D cast, i.e. 'cast(int)a' vs 'cast(int) a' or '(int)a' vs '(int) a'. @@ -618,11 +622,11 @@ sp_after_newop_paren = ignore # ignore/add/remove/force sp_inside_newop_paren = ignore # ignore/add/remove/force # Controls the space after open paren of the new operator: 'new(foo) BAR'. -# Have precedence of sp_inside_newop_paren. +# Overrides sp_inside_newop_paren. sp_inside_newop_paren_open = ignore # ignore/add/remove/force # Controls the space before close paren of the new operator: 'new(foo) BAR'. -# Have precedence of sp_inside_newop_paren. +# Overrides sp_inside_newop_paren. sp_inside_newop_paren_close = ignore # ignore/add/remove/force # Controls the spaces before a trailing or embedded comment. @@ -912,6 +916,9 @@ indent_using_block = true # false/true # 2: When the `:` is a continuation, indent it under `?` indent_ternary_operator = 0 # unsigned number +# If true, ignore indent and align for asm blocks as they have their own indentation. +indent_ignore_asm_block = false # false/true + # # Newline adding and removing options # @@ -976,7 +983,7 @@ nl_func_var_def_blk = 0 # unsigned number # The number of newlines before a block of typedefs # 0 = No change (default) -# the option 'nl_after_access_spec' takes preference over 'nl_typedef_blk_start'. +# is overridden by the option 'nl_after_access_spec'. nl_typedef_blk_start = 0 # unsigned number # The number of newlines after a block of typedefs @@ -989,7 +996,7 @@ nl_typedef_blk_in = 0 # unsigned number # The number of newlines before a block of variable definitions not at the top of a function body # 0 = No change (default) -# the option 'nl_after_access_spec' takes preference over 'nl_var_def_blk_start'. +# is overridden by the option 'nl_after_access_spec'. nl_var_def_blk_start = 0 # unsigned number # The number of newlines after a block of variable definitions not at the top of a function body @@ -1174,6 +1181,9 @@ nl_func_def_paren_empty = remove # ignore/add/remove/force # Add or remove newline between a function name and the opening '(' in the call nl_func_call_paren = remove # ignore/add/remove/force +# Overrides nl_func_call_paren for functions with no parameters. +nl_func_call_paren_empty = remove # ignore/add/remove/force + # Add or remove newline after '(' in a function declaration. nl_func_decl_start = ignore # ignore/add/remove/force @@ -1228,6 +1238,9 @@ nl_func_decl_empty = ignore # ignore/add/remove/force # Add or remove newline between '()' in a function definition. nl_func_def_empty = ignore # ignore/add/remove/force +# Add or remove newline between '()' in a function call. +nl_func_call_empty = ignore # ignore/add/remove/force + # Whether to add newline after '(' in a function call if '(' and ')' are in different lines. nl_func_call_start_multi_line = false # false/true @@ -1455,7 +1468,7 @@ nl_before_access_spec = 2 # unsigned number # The number of newlines after a 'private:', 'public:', 'protected:', 'signals:' or 'slots:' label. # 0 = No change. -# the option 'nl_after_access_spec' takes preference over 'nl_typedef_blk_start' and 'nl_var_def_blk_start'. +# Overrides 'nl_typedef_blk_start' and 'nl_var_def_blk_start'. nl_after_access_spec = 1 # unsigned number # The number of newlines between a function def and the function comment. @@ -1574,8 +1587,8 @@ align_with_tabs = false # false/true # Whether to bump out to the next tab when aligning. align_on_tabstop = false # false/true -# Whether to left-align numbers. -align_number_left = false # false/true +# Whether to right-align numbers. +align_number_right = false # false/true # Whether to keep whitespace not required for alignment. align_keep_extra_space = false # false/true From 6b8de44b9efa58b51b73fc65c84fae70be0ff996 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Wed, 28 Feb 2018 11:07:30 -0800 Subject: [PATCH 2/2] work around overmatching of nl_fcall_brace, since we don't use it just ignore it (which is the default anyway) --- .../ament_uncrustify/configuration/ament_code_style.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ament_uncrustify/ament_uncrustify/configuration/ament_code_style.cfg b/ament_uncrustify/ament_uncrustify/configuration/ament_code_style.cfg index e074e69e..db5b7f61 100644 --- a/ament_uncrustify/ament_uncrustify/configuration/ament_code_style.cfg +++ b/ament_uncrustify/ament_uncrustify/configuration/ament_code_style.cfg @@ -1009,7 +1009,7 @@ nl_var_def_blk_in = 0 # unsigned number # Add or remove newline between a function call's ')' and '{', as in: # list_for_each(item, &list) { }. -nl_fcall_brace = remove # ignore/add/remove/force +nl_fcall_brace = ignore # ignore/add/remove/force # Add or remove newline between 'enum' and '{'. nl_enum_brace = force # ignore/add/remove/force