#
# OpenSCAD uncrustify C++ config
#
# A reasoning on why this setup is maybe not well accessible
# can be found in this article:
# https://alexandersandberg.com/tabs-for-accessibility/
#
# If you have any accessibilty issues like mentioned in this
# article, please file a github issue so a possible change of
# coding style can be considered.

#
# General indentation strategy
#
input_tab_size=2
output_tab_size=2
indent_with_tabs=0
indent_columns=output_tab_size

indent_class=true
indent_namespace=false
indent_extern=false
indent_align_assign=false

#
# Alignment
#
align_right_cmt_span=0

#
# Code modification
#
mod_remove_extra_semicolon=true
mod_add_long_ifdef_endif_comment=10
mod_add_long_namespace_closebrace_comment=30

#
# Newline management
#
nl_func_leave_one_liners=true
nl_class_brace=force
nl_create_if_one_liner=true
nl_if_brace=remove
nl_brace_else=remove
nl_elseif_brace=remove
nl_else_brace=remove
nl_else_if=remove
nl_for_brace=remove
nl_while_brace=remove
nl_do_brace=remove
nl_brace_while=remove
nl_switch_brace=remove
nl_create_while_one_liner=false
nl_brace_catch=remove

#
# Spacing rules
#
sp_before_semi_for=remove
sp_after_semi_for=force
sp_paren_brace=force
sp_before_sparen=force
sp_inside_sparen=remove
sp_inside_paren=remove
sp_inside_fparens=remove
sp_inside_fparen=remove

sp_before_byref=remove
sp_before_unnamed_byref=ignore
sp_before_byref_func=remove
sp_after_byref=force
sp_after_byref_func=force

sp_before_ptr_star=force
sp_before_unnamed_ptr_star=ignore
sp_before_ptr_star_func=force
sp_after_ptr_star=remove
sp_after_ptr_star_func=remove
sp_after_ptr_star_qualifier=remove
sp_between_ptr_star=remove
sp_ptr_star_paren=remove

sp_arith=force
sp_assign=force
sp_compare=force
sp_after_comma=add
sp_before_comma=remove

sp_template_angle=force
sp_before_angle=remove
sp_inside_angle=remove
sp_after_angle=force
sp_angle_paren=remove
sp_angle_paren_empty=remove
sp_angle_word=force
sp_angle_shift=remove
sp_permit_cpp11_shift=true

sp_after_operator=remove
sp_after_operator_sym=remove
sp_after_operator_sym_empty=remove

sp_func_proto_paren=remove
sp_func_def_paren=remove
sp_func_call_paren=remove

sp_else_brace=force
sp_brace_else=force
sp_brace_catch=force

sp_before_case_colon=remove
sp_before_class_colon=force
sp_after_class_colon=force
sp_before_constr_colon=force
sp_after_constr_colon=force

