
# see https://github.com/CppCXY/EmmyLuaCodeStyle
[*.lua]
# [basic code reformat option]
# optional space/tab
indent_style = space
# if indent_style is space, this is valid
indent_size = 4
# if indent_style is tab, this is valid
tab_width = 4
# only support number
continuation_indent_size = 4
# if true, continuation_indent_size for local or assign statement is invalid
# however, if the expression list has cross row expression, it will not be aligned to the first expression
local_assign_continuation_align_to_first_expression = false
# function call expression's args will align to first arg
# however, if the args has cross row arg, it will not be aligned to the first arg
align_call_args = false
# if true, all function define params will align to first param
align_function_define_params = true
# if true, format like this "local t = { 1, 2, 3 }"
keep_one_space_between_table_and_bracket = true
# if indent_style is tab, this option is invalid
align_table_field_to_first_field = false
# if true, ormat like this "local t <const> = 1"
keep_one_space_between_namedef_and_attribute = false
# see document for detail
continuous_assign_statement_align_to_equal_sign = true
# see document for detail
continuous_assign_table_field_align_to_equal_sign = true
# if true, the label loses its current indentation
label_no_indent = false
# if true, there will be no indentation in the do statement
do_statement_no_indent = false
# if true, the conditional expression of the if statement will not be a continuation line indent
if_condition_no_continuation_indent = false

# optional crlf/lf
end_of_line = auto

# [Row layout]
# The following configuration supports three expressions
# minLine:${n}   
# keepLine   
# KeepLine:${n}

keep_line_after_if_statement = minLine:0
keep_line_after_do_statement = minLine:0
keep_line_after_while_statement = minLine:0
keep_line_after_repeat_statement = minLine:0
keep_line_after_for_statement = minLine:0
keep_line_after_local_or_assign_statement = keepLine
keep_line_after_function_define_statement = keepLine:1

# [diagnostic]
# the following is code diagnostic options
enable_check_codestyle = true
# this mean utf8 length
max_line_length = 120
# this will check text end with new line(format always end with new line)
insert_final_newline = true

# [name style check]
enable_name_style_check = false
# the following is name style check rule 
# base option off/camel_case/snake_case/upper_snake_case/pascal_case/same(filename/first_param/'<const string>', snake_case/pascal_case/camel_case)
# all option can use '|' represent or 
# for example:
# snake_case | upper_snake_case
# same(first_param, snake_case)
# same('m')
local_name_define_style = snake_case
function_param_name_style = snake_case
function_name_define_style = snake_case
local_function_name_define_style = snake_case
table_field_name_define_style = snake_case
global_variable_name_define_style = snake_case|upper_snake_case
module_name_define_style = same('m')|same(filename, snake_case)
require_module_name_style = same(first_param, snake_case)
class_name_define_style = same(filename, snake_case)

[{indent_style-eq-space.lua}]
# optional space/tab
indent_style = space
[{indent_style-eq-tab.lua}]
# optional space/tab
indent_style = tab
[{indent_size-eq-2.lua}]
indent_style = space
indent_size = 2
[{indent_size-eq-4.lua}]
indent_style = space
indent_size = 4
[{tab_width-eq-4.lua}]
indent_style=tab
tab_width=4
[{tab_width-eq-8.lua}]
indent_style=tab
tab_width=8
[{continuation_indent_size-eq-4.lua}]
continuation_indent_size = 4
[{continuation_indent_size-eq-8.lua}]
continuation_indent_size = 8
[{local_assign_continuation_align_to_first_expression-eq-true.lua}]
local_assign_continuation_align_to_first_expression = true
[{align_call_args-eq-true.lua}]
align_call_args = true
[{align_call_args-eq-only_after_more_indention_statement.lua}]
align_call_args = only_after_more_indention_statement 
[{keep_one_space_between_call_args_and_parentheses-eq-true.lua}]
keep_one_space_between_call_args_and_parentheses = true
[{align_function_define_params-eq-true.lua}]
align_function_define_params = true
[{keep_one_space_between_table_and_bracket-eq-true.lua}]
keep_one_space_between_table_and_bracket = true
[{keep_one_space_between_table_and_bracket-eq-false.lua}]
keep_one_space_between_table_and_bracket = false
[{align_table_field_to_first_field-eq-true.lua}]
align_table_field_to_first_field = true
[{keep_one_space_between_namedef_and_attribute-eq-true.lua}]
keep_one_space_between_namedef_and_attribute = true
[{continuous_assign_statement_align_to_equal_sign-eq-true.lua}]
continuous_assign_statement_align_to_equal_sign = true
[{continuous_assign_statement_align_to_equal_sign-eq-false.lua}]
continuous_assign_statement_align_to_equal_sign = false
[{continuous_assign_table_field_align_to_equal_sign-eq-true.lua}]
continuous_assign_table_field_align_to_equal_sign = true
[{continuous_assign_table_field_align_to_equal_sign-eq-false.lua}]
continuous_assign_table_field_align_to_equal_sign = false
[{label_no_indent-eq-true.lua}]
label_no_indent = true
[{do_statement_no_indent-eq-true.lua}]
do_statement_no_indent = true
[{if_condition_no_continuation_indent-eq-true.lua}]
if_condition_no_continuation_indent = true
[{max_continuous_line_distance-eq-2.lua}]
max_continuous_line_distance = 2
[{table_append_expression_no_space-eq-true.lua}]
table_append_expression_no_space = true
[{if_condition_align_with_each_other-eq-true.lua}]
if_condition_align_with_each_other = true
[{long_chain_expression_allow_one_space_after_colon-eq-true.lua}]
long_chain_expression_allow_one_space_after_colon = true
[{quote_style-eq-single.lua}]
quote_style = single
[{quote_style-eq-double.lua}]
quote_style = double
[{call_arg_parentheses-eq-remove.lua}]
call_arg_parentheses = remove
[{call_arg_parentheses-eq-keep.lua}]
call_arg_parentheses = keep
[{call_arg_parentheses-eq-remove_table_only.lua}]
call_arg_parentheses = remove_table_only
[{call_arg_parentheses-eq-remove_string_only.lua}]
call_arg_parentheses = remove_string_only
[{call_arg_parentheses-eq-unambiguous_remove_string_only.lua}]
call_arg_parentheses = unambiguous_remove_string_only
[{if_branch_comments_after_block_no_indent-eq-true.lua}]
if_branch_comments_after_block_no_indent = true
[{align_chained_expression_statement-eq-true.lua}]
align_chained_expression_statement = true
[{remove_empty_header_and_footer_lines_in_function-eq-true.lua}]
remove_empty_header_and_footer_lines_in_function = true
[{remove_expression_list_finish_comma-eq-true.lua}]
remove_expression_list_finish_comma = true
[{space_option.lua}]
space_before_function_open_parenthesis = true
space_before_open_square_bracket = true
[{minLine-eq-1.lua}]
keep_line_after_if_statement = minLine:1
keep_line_after_do_statement = minLine:1
keep_line_after_while_statement = minLine:1
keep_line_after_repeat_statement = minLine:1
keep_line_after_for_statement = minLine:1
keep_line_after_local_or_assign_statement = minLine:1
keep_line_after_function_define_statement = minLine:1
[{table_separator_style-eq-comma.lua}]
table_separator_style = comma
[{table_separator_style-eq-semicolon.lua}]
table_separator_style = semicolon
[{trailing_table_separator-eq-never.lua}]
trailing_table_separator = never
[{trailing_table_separator-eq-always.lua}]
trailing_table_separator = always
[{trailing_table_separator-eq-smart.lua}]
trailing_table_separator = smart

