refactor: upgrade uncrustify config version to 0.74.0

Disable formatting for assert.h since there's a bug that results in a
segmentation fault in uncrustify.
This commit is contained in:
Dundar Göc
2021-11-22 10:57:37 +01:00
parent fd6df7481a
commit 849f104c27
9 changed files with 293 additions and 188 deletions

View File

@@ -1,3 +1,5 @@
// uncrustify:off
#ifndef NVIM_ASSERT_H #ifndef NVIM_ASSERT_H
#define NVIM_ASSERT_H #define NVIM_ASSERT_H

View File

@@ -3919,7 +3919,8 @@ static buf_T *ins_compl_next_buf(buf_T *buf, int flag)
/// Get the user-defined completion function name for completion 'type' /// Get the user-defined completion function name for completion 'type'
static char_u *get_complete_funcname(int type) { static char_u *get_complete_funcname(int type)
{
switch (type) { switch (type) {
case CTRL_X_FUNCTION: case CTRL_X_FUNCTION:
return curbuf->b_p_cfu; return curbuf->b_p_cfu;
@@ -7630,16 +7631,34 @@ int hkmap(int c)
KAFsofit, hKAF, LAMED, MEMsofit, MEM, NUNsofit, NUN, SAMEH, AIN, KAFsofit, hKAF, LAMED, MEMsofit, MEM, NUNsofit, NUN, SAMEH, AIN,
PEIsofit, PEI, ZADIsofit, ZADI, KOF, RESH, hSHIN, TAV, PEIsofit, PEI, ZADIsofit, ZADI, KOF, RESH, hSHIN, TAV,
}; };
static char_u map[26] = static char_u map[26] = {
{ (char_u)hALEF /*a*/, (char_u)BET /*b*/, (char_u)hKAF /*c*/, (char_u)hALEF, // a
(char_u)DALET /*d*/, (char_u)-1 /*e*/, (char_u)PEIsofit /*f*/, (char_u)BET, // b
(char_u)GIMEL /*g*/, (char_u)HEI /*h*/, (char_u)IUD /*i*/, (char_u)hKAF, // c
(char_u)HET /*j*/, (char_u)KOF /*k*/, (char_u)LAMED /*l*/, (char_u)DALET, // d
(char_u)MEM /*m*/, (char_u)NUN /*n*/, (char_u)SAMEH /*o*/, (char_u)-1, // e
(char_u)PEI /*p*/, (char_u)-1 /*q*/, (char_u)RESH /*r*/, (char_u)PEIsofit, // f
(char_u)ZAIN /*s*/, (char_u)TAV /*t*/, (char_u)TET /*u*/, (char_u)GIMEL, // g
(char_u)VAV /*v*/, (char_u)hSHIN /*w*/, (char_u)-1 /*x*/, (char_u)HEI, // h
(char_u)AIN /*y*/, (char_u)ZADI /*z*/ }; (char_u)IUD, // i
(char_u)HET, // j
(char_u)KOF, // k
(char_u)LAMED, // l
(char_u)MEM, // m
(char_u)NUN, // n
(char_u)SAMEH, // o
(char_u)PEI, // p
(char_u)-1, // q
(char_u)RESH, // r
(char_u)ZAIN, // s
(char_u)TAV, // t
(char_u)TET, // u
(char_u)VAV, // v
(char_u)hSHIN, // w
(char_u)-1, // x
(char_u)AIN, // y
(char_u)ZADI, // z
};
if (c == 'N' || c == 'M' || c == 'P' || c == 'C' || c == 'Z') { if (c == 'N' || c == 'M' || c == 'P' || c == 'C' || c == 'Z') {
return (int)(map[CharOrd(c)] - 1 + p_aleph); return (int)(map[CharOrd(c)] - 1 + p_aleph);

View File

@@ -1,4 +1,4 @@
# Uncrustify-0.73.0-199-0dfafb27 # Uncrustify-0.74.0
# #
# General options # General options
@@ -214,6 +214,10 @@ sp_after_ptr_star_func = remove # ignore/add/remove/force/not_defined
# function prototype or function definition. # function prototype or function definition.
sp_after_ptr_star_trailing = ignore # ignore/add/remove/force/not_defined sp_after_ptr_star_trailing = ignore # ignore/add/remove/force/not_defined
# Add or remove space between the pointer star '*' and the name of the variable
# in a function pointer definition.
sp_ptr_star_func_var = ignore # ignore/add/remove/force/not_defined
# Add or remove space after a pointer star '*', if followed by an open # Add or remove space after a pointer star '*', if followed by an open
# parenthesis, as in 'void* (*)()'. # parenthesis, as in 'void* (*)()'.
sp_ptr_star_paren = ignore # ignore/add/remove/force/not_defined sp_ptr_star_paren = ignore # ignore/add/remove/force/not_defined
@@ -311,19 +315,33 @@ sp_permit_cpp11_shift = false # true/false
# 'while', etc.). # 'while', etc.).
sp_before_sparen = force # ignore/add/remove/force/not_defined sp_before_sparen = force # ignore/add/remove/force/not_defined
# Add or remove space inside '(' and ')' of control statements. # Add or remove space inside '(' and ')' of control statements other than
# 'for'.
sp_inside_sparen = remove # ignore/add/remove/force/not_defined sp_inside_sparen = remove # ignore/add/remove/force/not_defined
# Add or remove space after '(' of control statements. # Add or remove space after '(' of control statements other than 'for'.
# #
# Overrides sp_inside_sparen. # Overrides sp_inside_sparen.
sp_inside_sparen_open = remove # ignore/add/remove/force/not_defined sp_inside_sparen_open = remove # ignore/add/remove/force/not_defined
# Add or remove space before ')' of control statements. # Add or remove space before ')' of control statements other than 'for'.
# #
# Overrides sp_inside_sparen. # Overrides sp_inside_sparen.
sp_inside_sparen_close = ignore # ignore/add/remove/force/not_defined sp_inside_sparen_close = ignore # ignore/add/remove/force/not_defined
# Add or remove space inside '(' and ')' of 'for' statements.
sp_inside_for = ignore # ignore/add/remove/force/not_defined
# Add or remove space after '(' of 'for' statements.
#
# Overrides sp_inside_for.
sp_inside_for_open = ignore # ignore/add/remove/force/not_defined
# Add or remove space before ')' of 'for' statements.
#
# Overrides sp_inside_for.
sp_inside_for_close = ignore # ignore/add/remove/force/not_defined
# Add or remove space between '((' or '))' of control statements. # Add or remove space between '((' or '))' of control statements.
sp_sparen_paren = ignore # ignore/add/remove/force/not_defined sp_sparen_paren = ignore # ignore/add/remove/force/not_defined
@@ -648,6 +666,11 @@ sp_func_class_paren = ignore # ignore/add/remove/force/not_defined
# and '()'. # and '()'.
sp_func_class_paren_empty = ignore # ignore/add/remove/force/not_defined sp_func_class_paren_empty = ignore # ignore/add/remove/force/not_defined
# Add or remove space after 'return'.
#
# Default: force
sp_return = force # ignore/add/remove/force/not_defined
# Add or remove space between 'return' and '('. # Add or remove space between 'return' and '('.
sp_return_paren = force # ignore/add/remove/force/not_defined sp_return_paren = force # ignore/add/remove/force/not_defined
@@ -971,11 +994,31 @@ sp_inside_newop_paren_open = ignore # ignore/add/remove/force/not_defined
# Overrides sp_inside_newop_paren. # Overrides sp_inside_newop_paren.
sp_inside_newop_paren_close = ignore # ignore/add/remove/force/not_defined sp_inside_newop_paren_close = ignore # ignore/add/remove/force/not_defined
# Add or remove space before a trailing or embedded comment. # Add or remove space before a trailing comment.
sp_before_tr_emb_cmt = add # ignore/add/remove/force/not_defined sp_before_tr_cmt = add # ignore/add/remove/force/not_defined
# Number of spaces before a trailing or embedded comment. # Number of spaces before a trailing comment.
sp_num_before_tr_emb_cmt = 2 # unsigned number sp_num_before_tr_cmt = 2 # unsigned number
# Add or remove space before an embedded comment.
#
# Default: force
sp_before_emb_cmt = force # ignore/add/remove/force/not_defined
# Number of spaces before an embedded comment.
#
# Default: 1
sp_num_before_emb_cmt = 1 # unsigned number
# Add or remove space after an embedded comment.
#
# Default: force
sp_after_emb_cmt = force # ignore/add/remove/force/not_defined
# Number of spaces after an embedded comment.
#
# Default: 1
sp_num_after_emb_cmt = 1 # unsigned number
# (Java) Add or remove space between an annotation and the open parenthesis. # (Java) Add or remove space between an annotation and the open parenthesis.
sp_annotation_paren = ignore # ignore/add/remove/force/not_defined sp_annotation_paren = ignore # ignore/add/remove/force/not_defined
@@ -1216,12 +1259,16 @@ indent_sparen_extra = 0 # number
indent_relative_single_line_comments = true # true/false indent_relative_single_line_comments = true # true/false
# Spaces to indent 'case' from 'switch'. Usually 0 or indent_columns. # Spaces to indent 'case' from 'switch'. Usually 0 or indent_columns.
# It might wise to choose the same value for the option indent_case_brace. # It might be wise to choose the same value for the option indent_case_brace.
indent_switch_case = 0 # unsigned number indent_switch_case = 0 # unsigned number
# Spaces to indent the body of a 'switch' before any 'case'.
# Usually the same as indent_columns or indent_switch_case.
indent_switch_body = 0 # unsigned number
# Spaces to indent '{' from 'case'. By default, the brace will appear under # Spaces to indent '{' from 'case'. By default, the brace will appear under
# the 'c' in case. Usually set to 0 or indent_columns. Negative values are OK. # the 'c' in case. Usually set to 0 or indent_columns. Negative values are OK.
# It might wise to choose the same value for the option indent_switch_case. # It might be wise to choose the same value for the option indent_switch_case.
indent_case_brace = 0 # number indent_case_brace = 0 # number
# indent 'break' with 'case' from 'switch'. # indent 'break' with 'case' from 'switch'.
@@ -1236,13 +1283,31 @@ indent_switch_pp = true # true/false
# Usually 0. # Usually 0.
indent_case_shift = 0 # unsigned number indent_case_shift = 0 # unsigned number
# Whether to align comments before 'case' with the 'case'.
#
# Default: true
indent_case_comment = true # true/false
# Whether to indent comments not found in first column.
#
# Default: true
indent_comment = true # true/false
# Whether to indent comments found in first column. # Whether to indent comments found in first column.
indent_col1_comment = false # true/false indent_col1_comment = false # true/false
# Whether to indent multi string literal in first column. # Whether to indent multi string literal in first column.
indent_col1_multi_string_literal = false # true/false indent_col1_multi_string_literal = false # true/false
# How to indent goto labels. # Align comments on adjacent lines that are this many columns apart or less.
#
# Default: 3
indent_comment_align_thresh = 3 # unsigned number
# Whether to ignore indent for goto labels.
indent_ignore_label = false # true/false
# How to indent goto labels. Requires indent_ignore_label=false.
# #
# >0: Absolute column where 1 is the leftmost column # >0: Absolute column where 1 is the leftmost column
# <=0: Subtract from brace indent # <=0: Subtract from brace indent
@@ -1414,7 +1479,7 @@ indent_using_block = true # true/false
# 0: Off (default) # 0: Off (default)
# 1: When the `if_false` is a continuation, indent it under `if_false` # 1: When the `if_false` is a continuation, indent it under `if_false`
# 2: When the `:` is a continuation, indent it under `?` # 2: When the `:` is a continuation, indent it under `?`
indent_ternary_operator = 2 # unsigned number indent_ternary_operator = 0 # unsigned number
# Whether to indent the statements inside ternary operator. # Whether to indent the statements inside ternary operator.
indent_inside_ternary_operator = false # true/false indent_inside_ternary_operator = false # true/false
@@ -2622,6 +2687,22 @@ align_right_cmt_at_col = 0 # unsigned number
# 0: Don't align (default). # 0: Don't align (default).
align_func_proto_span = 0 # unsigned number align_func_proto_span = 0 # unsigned number
# How to consider (or treat) the '*' in the alignment of function prototypes.
#
# 0: Part of the type 'void * foo();' (default)
# 1: Part of the function 'void *foo();'
# 2: Dangling 'void *foo();'
# Dangling: the '*' will not be taken into account when aligning.
align_func_proto_star_style = 0 # unsigned number
# How to consider (or treat) the '&' in the alignment of function prototypes.
#
# 0: Part of the type 'long & foo();' (default)
# 1: Part of the function 'long &foo();'
# 2: Dangling 'long &foo();'
# Dangling: the '&' will not be taken into account when aligning.
align_func_proto_amp_style = 0 # unsigned number
# The threshold for aligning function prototypes. # The threshold for aligning function prototypes.
# Use a negative number for absolute thresholds. # Use a negative number for absolute thresholds.
# #
@@ -3101,6 +3182,9 @@ pp_indent_in_guard = false # true/false
# indented from column 1. # indented from column 1.
pp_define_at_level = false # true/false pp_define_at_level = false # true/false
# Whether to indent '#include' at the brace level.
pp_include_at_level = false # true/false
# Whether to ignore the '#define' body while formatting. # Whether to ignore the '#define' body while formatting.
pp_ignore_define_body = false # true/false pp_ignore_define_body = false # true/false
@@ -3307,5 +3391,5 @@ set QUESTION REAL_FATTR_CONST
set QUESTION REAL_FATTR_NONNULL_ALL set QUESTION REAL_FATTR_NONNULL_ALL
set QUESTION REAL_FATTR_PURE set QUESTION REAL_FATTR_PURE
set QUESTION REAL_FATTR_WARN_UNUSED_RESULT set QUESTION REAL_FATTR_WARN_UNUSED_RESULT
# option(s) with 'not default' value: 87 # option(s) with 'not default' value: 86
# #