Skip to content

Commit 1909d3e

Browse files
committed
更新构建脚本
1 parent 5f5295e commit 1909d3e

File tree

3 files changed

+129
-92
lines changed

3 files changed

+129
-92
lines changed

.editorconfig

Lines changed: 117 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,128 @@
1+
12
# see https://github.com/CppCXY/EmmyLuaCodeStyle
23
[*.lua]
3-
# [basic code reformat option]
4+
# [basic]
5+
46
# optional space/tab
57
indent_style = space
68
# if indent_style is space, this is valid
79
indent_size = 4
810
# if indent_style is tab, this is valid
911
tab_width = 4
10-
# only support number
11-
continuation_indent_size = 4
12-
# if true, continuation_indent_size for local or assign statement is invalid
13-
# however, if the expression list has cross row expression, it will not be aligned to the first expression
14-
local_assign_continuation_align_to_first_expression = false
15-
# function call expression's args will align to first arg
16-
# however, if the args has cross row arg, it will not be aligned to the first arg
17-
align_call_args = false
18-
# if true, format like this "print( "123", 456 )"
19-
keep_one_space_between_call_args_and_parentheses = false
20-
# if true, all function define params will align to first param
21-
align_function_define_params = true
22-
# if true, format like this "local t = { 1, 2, 3 }"
23-
keep_one_space_between_table_and_bracket = true
24-
# if indent_style is tab, this option is invalid
25-
align_table_field_to_first_field = false
26-
# if true, ormat like this "local t <const> = 1"
27-
keep_one_space_between_namedef_and_attribute = false
28-
# continous line distance
29-
max_continuous_line_distance = 1
30-
# if true, iff any one of the consecutive rows meets the condition of aligning to the equal sign,
31-
# the consecutive rows will be aligned to the equal sign
32-
weak_alignment_rule = true
33-
# see document for detail
34-
continuous_assign_statement_align_to_equal_sign = true
35-
# see document for detail
36-
continuous_assign_table_field_align_to_equal_sign = true
37-
# if true, the label loses its current indentation
38-
label_no_indent = false
39-
# if true, there will be no indentation in the do statement
40-
do_statement_no_indent = false
41-
# if true, the conditional expression of the if statement will not be a continuation line indent
42-
if_condition_no_continuation_indent = false
43-
44-
45-
# optional crlf/lf
46-
end_of_line = auto
47-
detect_end_of_line = true
48-
49-
# [line layout]
50-
# The following configuration supports three expressions
51-
# minLine:${n}
52-
# keepLine
53-
# KeepLine:${n}
54-
55-
keep_line_after_if_statement = minLine:0
56-
keep_line_after_do_statement = minLine:0
57-
keep_line_after_while_statement = minLine:0
58-
keep_line_after_repeat_statement = minLine:0
59-
keep_line_after_for_statement = minLine:0
60-
keep_line_after_local_or_assign_statement = keepLine
61-
keep_line_after_function_define_statement = keepLine:1
62-
63-
# [diagnostic]
64-
# the following is code diagnostic options
65-
enable_check_codestyle = true
66-
# this mean utf8 length
12+
# none/single/double
13+
quote_style = none
14+
15+
continuation_indent = 4
16+
17+
# this mean utf8 length , if this is 'unset' then the line width is no longer checked
18+
# this option decides when to chopdown the code
6719
max_line_length = 120
68-
# this will check text end with new line(format always end with new line)
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 = auto
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+
33+
# this will check text end with new line
6934
insert_final_newline = true
7035

71-
# [name style check]
72-
enable_name_style_check = true
73-
# the following is name style check rule
74-
# base option off/camel_case/snake_case/upper_snake_case/pascal_case/same(filename/first_param/'<const string>', snake_case/pascal_case/camel_case)
75-
# all option can use '|' represent or
76-
# for example:
77-
# snake_case | upper_snake_case
78-
# same(first_param, snake_case)
79-
# same('m')
80-
local_name_define_style = camel_case|upper_snake_case
81-
function_param_name_style = camel_case
82-
function_name_define_style = camel_case
83-
local_function_name_define_style = camel_case
84-
table_field_name_define_style = camel_case|pascal_case
85-
global_variable_name_define_style = camel_case|upper_snake_case
86-
module_name_define_style = camel_case
87-
require_module_name_style = camel_case
88-
class_name_define_style = camel_case
89-
table_append_expression_no_space = true
90-
if_condition_align_with_each_other = true
36+
# [space]
37+
space_around_table_field_list = true
38+
39+
space_before_attribute = true
40+
41+
space_before_function_open_parenthesis = false
42+
43+
space_before_function_call_open_parenthesis = false
44+
45+
space_before_closure_open_parenthesis = true
46+
47+
space_before_function_call_single_arg = true
48+
49+
space_before_open_square_bracket = false
50+
51+
space_inside_function_call_parentheses = false
52+
53+
space_inside_function_param_list_parentheses = false
54+
55+
space_inside_square_brackets = false
56+
57+
# like t[#t+1] = 1
58+
space_around_table_append_operator = true
59+
60+
ignore_spaces_inside_function_call = false
61+
62+
space_before_inline_comment = 1
63+
64+
# [operator space]
65+
space_around_math_operator = true
66+
67+
space_after_comma = true
68+
69+
space_after_comma_in_for_statement = true
70+
71+
space_around_concat_operator = true
72+
73+
# [align]
74+
75+
align_call_args = false
76+
77+
align_function_params = true
78+
79+
align_continuous_assign_statement = true
80+
81+
align_continuous_rect_table_field = true
82+
83+
align_if_branch = true
84+
85+
align_array_table = true
86+
87+
# [indent]
88+
89+
never_indent_before_if_condition = false
90+
91+
never_indent_comment_on_if_branch = false
92+
93+
# [line space]
94+
95+
# The following configuration supports four expressions
96+
# keep
97+
# fixed(n)
98+
# min(n)
99+
# max(n)
100+
# for eg. min(2)
101+
102+
line_space_after_if_statement = keep
103+
104+
line_space_after_do_statement = keep
105+
106+
line_space_after_while_statement = keep
107+
108+
line_space_after_repeat_statement = keep
109+
110+
line_space_after_for_statement = keep
111+
112+
line_space_after_local_or_assign_statement = keep
113+
114+
line_space_after_function_statement = fixed(2)
115+
116+
line_space_after_expression_statement = keep
117+
118+
line_space_after_comment = keep
119+
120+
# [line break]
121+
break_all_list_when_line_exceed = false
122+
123+
auto_collapse_lines = false
124+
125+
# [preference]
126+
ignore_space_after_colon = true
127+
128+
remove_call_expression_list_finish_comma = false

make/code_format.lua

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,22 @@ lm:source_set 'code_format' {
1414
-- codeFormatLib
1515
"CodeFormatLib/src/*.cpp",
1616
-- LuaParser
17-
"LuaParser/src/*.cpp",
18-
"LuaParser/src/LuaAstNode/LuaAstNode.cpp",
17+
"LuaParser/src/**.cpp",
1918
-- Util
2019
"Util/src/StringUtil.cpp",
2120
"Util/src/Utf8.cpp",
22-
--CodeService
23-
"CodeService/src/*.cpp",
24-
"CodeService/src/TypeFormat/*.cpp",
25-
"CodeService/src/Spell/*.cpp",
2621
"Util/src/SymSpell/*.cpp",
27-
"CodeService/src/FormatElement/*.cpp",
28-
"CodeService/src/NameStyle/*.cpp"
22+
--CodeService
23+
"CodeService/src/**.cpp",
2924
},
3025
windows = {
3126
-- 不要开哦
3227
-- flasg = "/W3 /WX"
3328
},
3429
macos = {
3530
flags = "-Wall -Werror",
36-
defines = "NOT_SUPPORT_FILE_SYSTEM"
3731
},
3832
linux = {
39-
defines = "NOT_SUPPORT_FILE_SYSTEM",
4033
flags = "-Wall -Werror"
4134
}
4235
}

meta/spell/lua_dict.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ formatter
219219
env
220220
math
221221
suc
222-
utf
223-
ansi
224-
222+
const
223+
param
224+
params
225+
func
226+
funcs
227+
enum
228+
enums
229+
substring
230+
globals

0 commit comments

Comments
 (0)