1
+
2
+ # see https://github.com/CppCXY/EmmyLuaCodeStyle
3
+ # https://github.com/CppCXY/EmmyLuaCodeStyle/blob/master/docs/format_config_EN.md
4
+ [* .lua ]
5
+ # [basic]
6
+
7
+ # optional space/tab
8
+ indent_style = space
9
+ # if indent_style is space, this is valid
10
+ indent_size = 4
11
+ # if indent_style is tab, this is valid
12
+ tab_width = 4
13
+ # none/single/double
14
+ quote_style = none
15
+
16
+ # only support number
17
+ continuation_indent_size = 4
18
+
19
+ # optional crlf/lf/cr/auto, if it is 'auto', in windows it is crlf other platforms are lf
20
+ end_of_line = auto
21
+
22
+ detect_end_of_line = false
23
+
24
+ # this mean utf8 length , if this is 'unset' then the line width is no longer checked
25
+ # this option decides when to chopdown the code
26
+ max_line_length = 170
27
+
28
+ # this will check text end with new line
29
+ insert_final_newline = true
30
+
31
+ # [function]
32
+
33
+ # function call expression's args will align to first arg
34
+ # optional true/false/only_after_more_indention_statement/only_not_exist_cross_row_expression
35
+ align_call_args = false
36
+
37
+ # if true, all function define params will align to first param
38
+ align_function_define_params = true
39
+
40
+ remove_expression_list_finish_comma = true
41
+
42
+ # keep/remove/remove_table_only/remove_string_only/unambiguous_remove_string_only
43
+ call_arg_parentheses = keep
44
+
45
+ # [table]
46
+
47
+ # optional none/comma/semicolon
48
+ table_separator_style = none
49
+
50
+ # optional keep/never/always/smart
51
+ trailing_table_separator = keep
52
+
53
+ # see document for detail
54
+ continuous_assign_table_field_align_to_equal_sign = false
55
+
56
+ # if true, format like this "local t = { 1, 2, 3 }"
57
+ space_around_table_field_list = false
58
+
59
+ space_around_table_append_operator = false
60
+
61
+ # if indent_style is tab, this option is invalid
62
+ align_table_field_to_first_field = false
63
+
64
+ # [statement]
65
+
66
+ align_chained_expression_statement = false
67
+
68
+ # continous line distance
69
+ max_continuous_line_distance = 1
70
+
71
+ # see document for detail
72
+ continuous_assign_statement_align_to_equal_sign = false
73
+
74
+ # if statement will align like switch case
75
+ if_condition_align_with_each_other = false
76
+
77
+ # if true, continuation_indent_size for local or assign statement is invalid
78
+ # however, if the expression list has cross row expression, it will not be aligned to the first expression
79
+ local_assign_continuation_align_to_first_expression = false
80
+
81
+ statement_inline_comment_space = 1
82
+
83
+ # [indentation]
84
+
85
+ # if true, the label loses its current indentation
86
+ label_no_indent = false
87
+ # if true, there will be no indentation in the do statement
88
+ do_statement_no_indent = false
89
+ # if true, the conditional expression of the if statement will not be a continuation line indent
90
+ if_condition_no_continuation_indent = false
91
+
92
+ if_branch_comments_after_block_no_indent = false
93
+
94
+ # [space]
95
+
96
+ # if true, t[#t+1] will not space wrapper '+'
97
+ table_append_expression_no_space = false
98
+
99
+ long_chain_expression_allow_one_space_after_colon = false
100
+
101
+ remove_empty_header_and_footer_lines_in_function = true
102
+
103
+ space_before_function_open_parenthesis = false
104
+
105
+ space_inside_function_call_parentheses = false
106
+
107
+ space_inside_function_param_list_parentheses = false
108
+
109
+ space_before_open_square_bracket = false
110
+
111
+ space_inside_square_brackets = false
112
+
113
+ # if true, ormat like this "local t <const> = 1"
114
+ keep_one_space_between_namedef_and_attribute = true
115
+
116
+ # [row_layout]
117
+ # The following configuration supports four expressions
118
+ # minLine:${n}
119
+ # keepLine
120
+ # keepLine:${n}
121
+ # maxLine:${n}
122
+
123
+ keep_line_after_if_statement = minLine:0
124
+
125
+ keep_line_after_do_statement = minLine:0
126
+
127
+ keep_line_after_while_statement = minLine:0
128
+
129
+ keep_line_after_repeat_statement = minLine:0
130
+
131
+ keep_line_after_for_statement = minLine:0
132
+
133
+ keep_line_after_local_or_assign_statement = keepLine
134
+
135
+ keep_line_after_function_define_statement = keepLine:1
136
+
137
+ keep_line_after_expression_statement = keepLine
138
+
139
+ # [diagnostic]
140
+
141
+ # the following is code diagnostic options
142
+ enable_check_codestyle = true
143
+
144
+ # [diagnostic.name_style]
145
+ enable_name_style_check = false
146
+ # the following is name style check rule
147
+ # base option off/camel_case/snake_case/upper_snake_case/pascal_case/same(filename/first_param/'<const string>', snake_case/pascal_case/camel_case)
148
+ # all option can use '|' represent or
149
+ # for example:
150
+ # snake_case | upper_snake_case
151
+ # same(first_param, snake_case)
152
+ # same('m')
153
+ local_name_define_style = snake_case
154
+
155
+ function_param_name_style = snake_case
156
+
157
+ function_name_define_style = snake_case
158
+
159
+ local_function_name_define_style = snake_case
160
+
161
+ table_field_name_define_style = snake_case
162
+
163
+ global_variable_name_define_style = snake_case|upper_snake_case
164
+
165
+ module_name_define_style = same('m')|same(filename, snake_case)
166
+
167
+ require_module_name_style = same(first_param, snake_case)
168
+
169
+ class_name_define_style = same(filename, snake_case)
170
+
171
+ # --- spaces
172
+ align_continuous_assign_statement = false
173
+
174
+ align_continuous_rect_table_field = false
175
+
176
+ align_if_branch = false
177
+
178
+ # --- spaces for matrix
179
+ align_array_table = true
0 commit comments