Commit c9afd8df authored by Nghia Truong's avatar Nghia Truong
Browse files

STYLE: Add options to uncrustify config file, including (but not limited to):

* Alignment of variables and comments
* Add/remove spaces when needed
* Enforce spaces around '*' and '&' of reference and pointer variables
* Remove redundant semicolons
* Break line between function return type and function definition
* Enforce position of boolean operators, making multiple-line boolean expressions easier to read
parent 446c5edc
......@@ -67,7 +67,16 @@ mod_full_brace_if = force # ignore/add/remove/force
mod_full_brace_while = force # ignore/add/remove/force
# Whether to remove superfluous semicolons
mod_remove_extra_semicolon = false # false/true
mod_remove_extra_semicolon = true # false/true
# Whether to sort consecutive single-line '#include' statements (C/C++) and
# '#import' statements (Objective-C). Be aware that this has the potential to
# break your code if your includes/imports have ordering dependencies.
# mod_sort_include = true # true/false
# Indeed, the mode above actually break the code
# Need to work on the code
# Add or remove newline between 'enum' and '{'
nl_enum_brace = force # ignore/add/remove/force
......@@ -135,6 +144,18 @@ nl_cpp_lambda_leave_one_liners = true # false/true
# The number of newlines after '}' of a multi-line function body.
nl_after_func_body = 2 # unsigned number
# Add or remove newline between return type and function name in a function
# definition.
nl_func_type_name = force # ignore/add/remove/force
# Add or remove newline between return type and function name in a prototype.
nl_func_proto_type_name = remove # ignore/add/remove/force
# Add or remove newline between return type and function name inside a class
# definition. If set to ignore, nl_func_type_name or nl_func_proto_type_name
# is used instead.
nl_func_type_name_class = remove # ignore/add/remove/force
# Add or remove space around compare operator '<', '>', '==', etc
sp_compare = force # ignore/add/remove/force
......@@ -187,9 +208,232 @@ sp_angle_shift = remove # ignore/add/remove/force
# sp_angle_shift cannot remove the space without this option.
sp_permit_cpp11_shift = true # false/true
# Add or remove space inside '{' and '}'.
sp_inside_braces = force # ignore/add/remove/force
# Add or remove space inside enum '{' and '}'.
sp_inside_braces_enum = force # ignore/add/remove/force
# Add or remove space inside struct/union '{' and '}'.
sp_inside_braces_struct = force # ignore/add/remove/force
# Add or remove space inside '(' and ')'.
sp_inside_paren = remove # ignore/add/remove/force
# Add or remove space inside empty function '()'.
sp_inside_fparens = remove # ignore/add/remove/force
# Add or remove space inside function '(' and ')'.
sp_inside_fparen = remove # ignore/add/remove/force
# Add or remove space between function name and '(' on function definition.
sp_func_def_paren = remove # ignore/add/remove/force
# Add or remove space between function name and '()' on function definition
# without parameters.
sp_func_def_paren_empty = remove # ignore/add/remove/force
# Add or remove space between function name and '(' on function calls.
sp_func_call_paren = remove # ignore/add/remove/force
# Add or remove space between function name and '()' on function calls without
# parameters. If set to 'ignore' (the default), sp_func_call_paren is used.
sp_func_call_paren_empty = remove # ignore/add/remove/force
# Add or remove space between function name and '(' on function declaration.
sp_func_proto_paren = remove # ignore/add/remove/force
# Add or remove space between function name and '()' on function declaration
# without parameters.
sp_func_proto_paren_empty = remove # ignore/add/remove/force
# Control the space after the opening of a C++ comment '// A' vs '//A'.
sp_cmt_cpp_start = ignore # ignore/add/remove/force
# Add or remove space between ')' and '{'.
sp_paren_brace = force # ignore/add/remove/force
# Add or remove space between ')' and '{' of function.
sp_fparen_brace = force # ignore/add/remove/force
# Add or remove space between ')' and a qualifier such as 'const'.
# Note: this option is currently not avaialbe in uncrustify 0.64
# sp_paren_qualifier = force # ignore/add/remove/force
# Add or remove space between ')' and 'noexcept'.
# Note: this option is currently not avaialbe in uncrustify 0.64
#sp_paren_noexcept = force # ignore/add/remove/force
# Add or remove space before pointer star '*'.
sp_before_ptr_star = remove # ignore/add/remove/force
# Add or remove space before pointer star '*' that isn't followed by a
# variable name. If set to 'ignore', sp_before_ptr_star is used instead.
sp_before_unnamed_ptr_star = remove # ignore/add/remove/force
# Add or remove space after pointer star '*', if followed by a word.
sp_after_ptr_star = force # ignore/add/remove/force
# Add or remove space after a pointer star '*', if followed by a function
# prototype or function definition.
sp_after_ptr_star_func = force # ignore/add/remove/force
# Add or remove space after a pointer star '*', if followed by an open
# parenthesis, as in 'void* (*)().
sp_ptr_star_paren = force # ignore/add/remove/force
# Add or remove space before a reference sign '&'.
sp_before_byref = remove # ignore/add/remove/force
# Add or remove space before a reference sign '&' that isn't followed by a
# variable name. If set to 'ignore', sp_before_byref is used instead.
sp_before_unnamed_byref = remove # ignore/add/remove/force
# Add or remove space after reference sign '&', if followed by a word.
sp_after_byref = force # ignore/add/remove/force
# Add or remove space after a reference sign '&', if followed by a function
# prototype or function definition.
sp_after_byref_func = force # ignore/add/remove/force
# Add or remove space before a reference sign '&', if followed by a function
# prototype or function definition.
sp_before_byref_func = remove # ignore/add/remove/force
# Add or remove space between 'template' and '<'.
# If set to ignore, sp_before_angle is used.
sp_template_angle = remove # ignore/add/remove/force
# Add or remove space before '<'.
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 inside '<>'.
# Note: this option is currently not avaialbe in uncrustify 0.64
#sp_inside_angle_empty = remove # ignore/add/remove/force
# Add or remove space between '>' and ':'.
# Note: this option is currently not avaialbe in uncrustify 0.64
#sp_angle_colon = remove # ignore/add/remove/force
# Add or remove space after '<>'.
sp_after_angle = remove # ignore/add/remove/force
# Add or remove space between '>' and '(' as found in 'new List<byte>(foo);'.
sp_angle_paren = remove # ignore/add/remove/force
# Add or remove space between '>' and '()' as found in 'new List<byte>();'.
sp_angle_paren_empty = remove # ignore/add/remove/force
# Add or remove space between '>' and a word as in 'List<byte> m;' or
# 'template <typename T> static ...'.
sp_angle_word = force # ignore/add/remove/force
# Add or remove space before '[' (except '[]').
sp_before_square = remove # ignore/add/remove/force
# Add or remove space before '[]'.
sp_before_squares = remove # ignore/add/remove/force
# Add or remove space inside a non-empty '[' and ']'.
sp_inside_square = remove # ignore/add/remove/force
# Whether to align macros wrapped with a backslash and a newline. This will
# not work right if the macro contains a multi-line comment.
align_nl_cont = true # true/false
# The span for aligning variable definitions.
#
# 0 = Don't align (default).
align_var_def_span = 1 # unsigned number
# How to align the '&' in variable definitions.
# 0=Part of the type
# 1=Part of the variable
# 2=Dangling
align_var_def_amp_style = 0 # number
# The span for aligning comments that end lines.
#
# 0 = Don't align (default).
align_right_cmt_span = 3 # unsigned number
# The span for aligning class (0=don't align)
align_var_class_span = 1 # number
# The threshold for aligning class member definitions.
# Use a negative number for absolute thresholds.
#
# 0 = No limit (default).
align_var_class_thresh = 10 # number
# Whether to align variable definitions in prototypes and functions.
align_func_params = true # true/false
# The span for aligning on '=' in assignments.
#
# 0 = Don't align (default).
align_assign_span = 1 # unsigned number
# The threshold for aligning on '=' in assignments.
# Use a negative number for absolute thresholds.
#
# 0 = No limit (default).
align_assign_thresh = 10 # number
# Whether to align lines that start with '<<' with previous '<<'.
#
# Default: true
align_left_shift = true # true/false
# Try to limit code width to N number of columns
code_width = 200 # number
#
# Positioning options
#
# The position of arithmetic operators in wrapped expressions.
pos_arith = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of assignment in wrapped expressions. Do not affect '='
# followed by '{'.
pos_assign = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of Boolean operators in wrapped expressions.
pos_bool = lead # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of comparison operators in wrapped expressions.
pos_compare = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of conditional operators, as in the '?' and ':' of
# 'expr ? stmt : stmt', in wrapped expressions.
pos_conditional = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of the comma in wrapped expressions.
pos_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of the comma in enum entries.
pos_enum_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of the comma in the base class list if there is more than one
# line. Affects nl_class_init_args.
pos_class_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of the comma in the constructor initialization list.
# Related to nl_constr_colon, nl_constr_init_args and pos_constr_colon.
pos_constr_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of trailing/leading class colon, between class and base class
# list. Affects nl_class_colon.
pos_class_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of colons between constructor and member initialization.
# Related to nl_constr_colon, nl_constr_init_args and pos_constr_comma.
pos_constr_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# If false, disable all multi-line comment changes, including cmt_width. keyword substitution and leading chars.
# Default=True.
# If enabled in IMSTK, it interferes with license header
......@@ -198,4 +442,3 @@ cmt_indent_multi = false # false/true
# The filename that contains text to insert at the head of a file if the file doesn't start with a C/C++ comment.
# Will substitute $(filename) with the current file's name.
cmt_insert_file_header = "../HeaderForSources.txt"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment