Skip to content

Commit fa5558b

Browse files
committed
整理模板配置
1 parent 457910d commit fa5558b

File tree

1 file changed

+53
-26
lines changed

1 file changed

+53
-26
lines changed

lua.template.editorconfig

Lines changed: 53 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,95 +10,114 @@ indent_size = 4
1010
tab_width = 4
1111
# none/single/double
1212
quote_style = none
13-
# keep/remove/remove_table_only/remove_string_only/unambiguous_remove_string_only
14-
call_arg_parentheses = keep
13+
1514
# only support number
1615
continuation_indent_size = 4
17-
# if true, continuation_indent_size for local or assign statement is invalid
18-
# however, if the expression list has cross row expression, it will not be aligned to the first expression
19-
local_assign_continuation_align_to_first_expression = false
2016

21-
# if true, ormat like this "local t <const> = 1"
22-
keep_one_space_between_namedef_and_attribute = true
17+
# optional crlf/lf/cr/auto, if it is 'auto', in windows it is crlf other platforms are lf
18+
end_of_line = auto
19+
20+
detect_end_of_line = false
21+
22+
# this mean utf8 length , if this is 'unset' then the line width is no longer checked
23+
# this option decides when to chopdown the code
24+
max_line_length = 120
25+
26+
# this will check text end with new line(format always end with new line)
27+
insert_final_newline = true
2328

2429
# [function]
2530
# function call expression's args will align to first arg
2631
# optional true/false/only_after_more_indention_statement
2732
align_call_args = false
2833

29-
3034
# if true, all function define params will align to first param
3135
align_function_define_params = true
3236

37+
remove_expression_list_finish_comma = true
38+
39+
# keep/remove/remove_table_only/remove_string_only/unambiguous_remove_string_only
40+
call_arg_parentheses = keep
41+
3342
# [table]
3443
# see document for detail
3544
continuous_assign_table_field_align_to_equal_sign = true
3645

37-
# [statement]
38-
align_chained_expression_statement = false
3946
# if true, format like this "local t = { 1, 2, 3 }"
4047
keep_one_space_between_table_and_bracket = true
48+
4149
# if indent_style is tab, this option is invalid
4250
align_table_field_to_first_field = false
51+
52+
# [statement]
53+
align_chained_expression_statement = false
54+
4355
# continous line distance
4456
max_continuous_line_distance = 1
57+
4558
# see document for detail
4659
continuous_assign_statement_align_to_equal_sign = true
4760

61+
# if statement will align like switch case
62+
if_condition_align_with_each_other = false
63+
64+
# if true, continuation_indent_size for local or assign statement is invalid
65+
# however, if the expression list has cross row expression, it will not be aligned to the first expression
66+
local_assign_continuation_align_to_first_expression = false
67+
68+
# [indentation]
4869
# if true, the label loses its current indentation
4970
label_no_indent = false
5071
# if true, there will be no indentation in the do statement
5172
do_statement_no_indent = false
5273
# if true, the conditional expression of the if statement will not be a continuation line indent
5374
if_condition_no_continuation_indent = false
54-
#
75+
5576
if_branch_comments_after_block_no_indent = false
77+
78+
# [space]
5679
# if true, t[#t+1] will not space wrapper '+'
5780
table_append_expression_no_space = false
58-
# if statement will align like switch case
59-
if_condition_align_with_each_other = false
6081

6182
long_chain_expression_allow_one_space_after_colon = false
6283

6384
remove_empty_header_and_footer_lines_in_function = true
6485

65-
remove_expression_list_finish_comma = true
66-
# optional crlf/lf/cr/auto, if it is 'auto', in windows it is crlf other platforms are lf
67-
end_of_line = auto
68-
#
69-
detect_end_of_line = false
70-
7186
space_before_function_open_parenthesis = false
7287

7388
space_before_open_square_bracket = false
7489

75-
# this mean utf8 length , if this is 'unset' then the line width is no longer checked
76-
max_line_length = 120
90+
# if true, ormat like this "local t <const> = 1"
91+
keep_one_space_between_namedef_and_attribute = true
7792

78-
# [line layout]
93+
# [row_layout]
7994
# The following configuration supports four expressions
8095
# minLine:${n}
8196
# keepLine
8297
# keepLine:${n}
8398
# maxLine:${n}
8499

85100
keep_line_after_if_statement = minLine:0
101+
86102
keep_line_after_do_statement = minLine:0
103+
87104
keep_line_after_while_statement = minLine:0
105+
88106
keep_line_after_repeat_statement = minLine:0
107+
89108
keep_line_after_for_statement = minLine:0
109+
90110
keep_line_after_local_or_assign_statement = keepLine
111+
91112
keep_line_after_function_define_statement = keepLine:1
113+
92114
keep_line_after_expression_statement = keepLine
93115

94116
# [diagnostic]
95117
# the following is code diagnostic options
96118
enable_check_codestyle = true
97119

98-
# this will check text end with new line(format always end with new line)
99-
insert_final_newline = true
100-
101-
# [name style check]
120+
# [diagnostic.name_style]
102121
enable_name_style_check = false
103122
# the following is name style check rule
104123
# base option off/camel_case/snake_case/upper_snake_case/pascal_case/same(filename/first_param/'<const string>', snake_case/pascal_case/camel_case)
@@ -108,11 +127,19 @@ enable_name_style_check = false
108127
# same(first_param, snake_case)
109128
# same('m')
110129
local_name_define_style = snake_case
130+
111131
function_param_name_style = snake_case
132+
112133
function_name_define_style = snake_case
134+
113135
local_function_name_define_style = snake_case
136+
114137
table_field_name_define_style = snake_case
138+
115139
global_variable_name_define_style = snake_case|upper_snake_case
140+
116141
module_name_define_style = same('m')|same(filename, snake_case)
142+
117143
require_module_name_style = same(first_param, snake_case)
144+
118145
class_name_define_style = same(filename, snake_case)

0 commit comments

Comments
 (0)