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