ambevar-dotfiles/.uncrustify.cfg

148 lines
4.9 KiB
INI

# Ambrevar C-style
# Inspired by K&R and Go, with function opening brace on the same line.
# We enforce some sane properties, such as UTF-8 and LF newlines.
# No alignment, tab-indented.
################################################################################
# General options
newlines = lf
utf8_bom = remove
utf8_byte = true
utf8_force = true
################################################################################
# Indenting
# 1=indent to level only, 2=indent with tabs
indent_with_tabs = 2
input_tab_size = 8
indent_columns = output_tab_size
# How to indent goto labels
# >0 : absolute column where 1 is the leftmost column
# <=0 : subtract from brace indent
indent_label = 0
# Whether to indent comments found in first column
indent_col1_comment = true # false/true
# The continuation indent. If non-zero, this overrides the indent of '(' and '=' continuation indents.
# For FreeBSD, this is set to 4. Negative value is absolute and not increased for each ( level
indent_continue = output_tab_size # number
################################################################################
# Code modifying options (non-whitespace)
mod_paren_on_return = remove # "return 1;" -> "return (1);"
mod_full_brace_if = force # "if (a) a--;" -> "if (a) { a--; }"
mod_full_brace_for = force
mod_full_brace_do = force
mod_full_brace_while = force
################################################################################
# Newline adding and removing options
nl_enum_brace = remove # "enum \n {" -> "enum {"
nl_union_brace = remove
nl_struct_brace = remove
nl_do_brace = remove
nl_if_brace = remove
nl_for_brace = remove
nl_else_brace = remove
nl_while_brace = remove
nl_switch_brace = remove
nl_fcall_brace = remove
nl_fdef_brace = remove
nl_brace_while = remove
nl_brace_else = remove
# Whether to not put blanks after '#ifxx', '#elxx', or before '#endif'
# nl_squeeze_ifdef = true
# Add or remove newline between return type and function name in a function definition
nl_func_type_name = remove
# Whether to remove blank lines before/after '}'/'{' respectively.
eat_blanks_before_close_brace = true
eat_blanks_after_open_brace = true
# nl_after_return = true
# nl_func_var_def_blk = 1
# nl_before_case = 1
################################################################################
# Spacing options
sp_arith = force
sp_assign = force
sp_bool = force
sp_compare = force
sp_before_semi = remove
sp_before_square = remove
sp_before_squares = remove
sp_inside_square = remove
sp_after_comma = force
sp_after_cast = remove # "(int) a" -> "(int)a"
sp_after_sparen = force # "if (){" -> "if () {"
sp_before_sparen = force # "if (" -> "if("
sp_inside_paren = remove # "( 1 )" -> "(1)"
sp_paren_paren = remove # space between (( and ))
sp_inside_fparen = remove # "( 1 )" -> "(1)" - functions
sp_inside_sparen = remove # "( 1 )" -> "(1)" - if/for/etc
sp_sizeof_paren = force # "sizeof(int)" -> "sizeof (int)"
sp_inside_braces = remove # "{ 1 }" -> "{1}"
sp_inside_braces_struct = remove # "{ 1 }" -> "{1}"
sp_inside_braces_enum = remove # "{ 1 }" -> "{1}"
sp_func_def_paren = remove # "int foo () {" -> "int foo() {"
sp_func_proto_paren = remove # "int foo ();" -> "int foo();"
sp_func_call_paren = remove # "foo (" -> "foo("
sp_return_paren = remove # "return (1);" -> "return(1);"
sp_else_brace = force # "else{" -> "else {"
sp_brace_else = force # "}else" -> "} else"
# Add or remove space before pointer star '*'
sp_before_ptr_star = force # ignore/add/remove/force
# Add or remove space between pointer stars '*'
sp_between_ptr_star = remove # ignore/add/remove/force
# Add or remove space after pointer star '*', if followed by a word.
sp_after_ptr_star = remove # ignore/add/remove/force
# Add or remove space between return type and function name
# A minimum of 1 is forced except for pointer return types.
sp_type_func = force
# Add or remove space between ')' and '(' of function
sp_fparen_brace = force
################################################################################
# Comment modifications
# Whether to change cpp-comments into c-comments
cmt_cpp_to_c = false
# Whether to put a star on subsequent comment lines
# cmt_star_cont = true
# If false, disable all multi-line comment changes, including cmt_width. keyword substitution, and leading chars.
cmt_indent_multi = false
# Set the comment reflow mode (default: 0)
# 0: no reflowing (apart from the line wrapping due to cmt_width)
# 1: no touching at all
# 2: full reflow
# cmt_reflow_mode = 0
################################################################################
# Preprocessor options
# Add or remove space after # based on pp_level of #if blocks
pp_space = remove
# Whether to indent #if/#else/#endif at the brace level (true) or from column 1 (false)
pp_indent_at_level = true # false/true
# Whether to indent '#define' at the brace level (true) or from column 1 (false)
pp_define_at_level = true # false/true