Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STYLE: Consistently indent C++ sources
This commit ensures consistent indentation for C++ source files. The adjustments were made in anticipation of upcoming changes that will introduce a standard configuration based on clang-format. The changes were applied after locally building uncrustify/uncrustify@0cdcdd92d and executing the following command: ``` uncrustify \ -l CPP \ -c /path/to/uncrustify.cfg \ --no-backup \ $(fd -e hpp -e h -e cpp -e cxx) ``` The `uncrustify.cfg` file includes the following non-default settings: ``` # Uncrustify-0.78.1-136-0cdcdd92d-dirty input_tab_size = 2 sp_enum_brace = ignore sp_pp_concat = ignore sp_after_type = ignore sp_angle_shift = ignore sp_before_semi = ignore sp_after_semi = ignore sp_after_semi_for = ignore sp_before_vardef_square = ignore sp_before_comma = ignore sp_paren_comma = ignore sp_after_constr_colon = ignore sp_before_constr_colon = ignore sp_before_case_colon = ignore sp_return = ignore sp_super_paren = ignore sp_this_paren = ignore sp_word_brace_ns = ignore sp_not = ignore sp_inv = ignore sp_addr = ignore sp_member = ignore sp_deref = ignore sp_sign = ignore sp_incdec = ignore sp_before_nl_cont = ignore sp_before_emb_cmt = ignore sp_after_emb_cmt = ignore indent_columns = 2 indent_with_tabs = 0 indent_class = true indent_constr_colon = true indent_switch_case = 2 indent_switch_body = 2 nl_assign_leave_one_liners = true nl_class_leave_one_liners = true nl_func_leave_one_liners = true nl_if_brace = remove nl_brace_else = force nl_elseif_brace = force nl_else_brace = remove cmt_indent_multi = false cmt_multi_first_len_minimum = 2 pp_multiline_define_body_indent = 2 # option(s) with 'not default' value: 44 # ``` This list of non-default was obtained by first building building uncrustify applying the patch below and running the following command: ``` uncrustify \ -c /path/to/complete-uncrustify.cfg \ --update-config \ -o /path/to/minimal-uncrustify.cfg ``` Patch applied to save a minimal configuration: ```diff diff --git a/src/uncrustify.cpp b/src/uncrustify.cpp index c8b2d3620..b282bbf57 100644 --- a/src/uncrustify.cpp +++ b/src/uncrustify.cpp @@ -936,7 +936,7 @@ int main(int argc, char *argv[]) { return(error); } - save_option_file(stdout, update_config_wd); + save_option_file(stdout, update_config_wd, true); return(EXIT_SUCCESS); } ```
- Loading branch information