11
22# see https://github.com/CppCXY/EmmyLuaCodeStyle
33[* .lua ]
4+ # [basic code reformat option]
45# optional space/tab
56indent_style = space
67# if indent_style is space, this is valid
78indent_size = 4
89# if indent_style is tab, this is valid
910tab_width = 4
11+ # only support number
1012continuation_indent_size = 4
13+ # if true, continuation_indent_size for local or assign statement is invalid
14+ # however, if the expression list has cross row expression, it will not be aligned to the first expression
15+ local_assign_continuation_align_to_first_expression = false
16+ # function call expression's args will align to first arg
17+ # however, if the args has cross row arg, it will not be aligned to the first arg
1118align_call_args = false
19+ # if true, format like this "print( "123", 456 )"
1220keep_one_space_between_call_args_and_parentheses = false
21+ # if true, all function define params will align to first param
1322align_function_define_params = true
23+ # if true, format like this "local t = { 1, 2, 3 }"
1424keep_one_space_between_table_and_bracket = true
15- align_table_field_to_first_field = true
25+ # if indent_style is tab, this option is invalid
26+ align_table_field_to_first_field = false
27+ # if true, ormat like this "local t <const> = 1"
1628keep_one_space_between_namedef_and_attribute = false
29+ # see document for detail
1730continuous_assign_statement_align_to_equal_sign = true
31+ # see document for detail
1832continuous_assign_table_field_align_to_equal_sign = true
33+ # if true, the label loses its current indentation
1934label_no_indent = false
35+ # if true, there will be no indentation in the do statement
2036do_statement_no_indent = false
37+ # if true, the conditional expression of the if statement will not be a continuation line indent
38+ if_condition_no_continuation_indent = false
39+
2140# optional crlf/lf
2241end_of_line = crlf
2342
43+ # [Row layout]
2444# The following configuration supports three expressions
2545# minLine:${n}
2646# keepLine
2747# KeepLine:${n}
2848
29- keep_line_after_if_statement = minLine:1
30- keep_line_after_do_statement = minLine:1
31- keep_line_after_while_statement = minLine:1
32- keep_line_after_repeat_statement = minLine:1
33- keep_line_after_for_statement = minLine:1
49+ keep_line_after_if_statement = minLine:0
50+ keep_line_after_do_statement = minLine:0
51+ keep_line_after_while_statement = minLine:0
52+ keep_line_after_repeat_statement = minLine:0
53+ keep_line_after_for_statement = minLine:0
3454keep_line_after_local_or_assign_statement = keepLine
3555keep_line_after_function_define_statement = keepLine:1
3656
57+ # [diagnostic]
3758# the following is code diagnostic options
3859enable_check_codestyle = true
3960# this mean utf8 length
4061max_line_length = 120
4162# this will check text end with new line(format always end with new line)
4263insert_final_newline = true
4364
44-
65+ # [name style check]
4566enable_name_style_check = false
4667# the following is name style check rule
4768# base option off/camel_case/snake_case/upper_snake_case/pascal_case/same(filename/first_param/'<const string>', snake_case/pascal_case/camel_case)
@@ -59,6 +80,7 @@ global_variable_name_define_style = snake_case|upper_snake_case
5980module_name_define_style = same('m')|same(filename, snake_case)
6081require_module_name_style = same(first_param, snake_case)
6182class_name_define_style = same(filename, snake_case)
83+
6284[{indent_style-eq-space.lua} ]
6385# optional space/tab
6486indent_style = space
@@ -71,4 +93,15 @@ indent_size = 2
7193[{indent_size-eq-4.lua} ]
7294indent_style = space
7395indent_size = 4
74-
96+ [{tab_width-eq-4.lua} ]
97+ indent_style =tab
98+ tab_width =4
99+ [{tab_width-eq-8.lua} ]
100+ indent_style =tab
101+ tab_width =8
102+ [{continuation_indent_size-eq-4.lua} ]
103+ continuation_indent_size = 4
104+ [{continuation_indent_size-eq-8.lua} ]
105+ continuation_indent_size = 8
106+ [{local_assign_continuation_align_to_first_expression-eq-true.lua} ]
107+ local_assign_continuation_align_to_first_expression = true
0 commit comments