Skip to content

Commit a92e5ca

Browse files
committed
add test
1 parent 2efc873 commit a92e5ca

File tree

8 files changed

+76
-2
lines changed

8 files changed

+76
-2
lines changed

Test/test_script/format_text/wait_format_by_option/.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ call_arg_parentheses = unambiguous_remove_string_only
159159
if_branch_comments_after_block_no_indent = true
160160
[{align_chained_expression_statement-eq-true.lua}]
161161
align_chained_expression_statement = true
162+
[{remove_empty_header_and_footer_lines_in_function-eq-true.lua}]
163+
remove_empty_header_and_footer_lines_in_function = true
164+
[{remove_expression_list_finish_comma-eq-true.lua}]
165+
remove_expression_list_finish_comma = true
162166
[{minLine-eq-1.lua}]
163167
keep_line_after_if_statement = minLine:1
164168
keep_line_after_do_statement = minLine:1
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
local f = function()
2+
3+
end
4+
5+
local function f2()
6+
-- body
7+
end
8+
9+
local function f3()
10+
11+
12+
-- body
13+
14+
end
15+
16+
local function f4()
17+
18+
local t = 13
19+
20+
end
21+
22+
local function f5()
23+
24+
f4(function()
25+
26+
local d = 13
27+
28+
end)
29+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--extend syntax
2+
local function f2(aaa,bbb,ccc,)
3+
end
4+
5+
f2(1,2,3,)

Test/test_script/format_text/wait_format_by_option_should_be/.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ call_arg_parentheses = unambiguous_remove_string_only
157157
if_branch_comments_after_block_no_indent = true
158158
[{align_chained_expression_statement-eq-true.lua}]
159159
align_chained_expression_statement = true
160+
[{remove_empty_header_and_footer_lines_in_function-eq-true.lua}]
161+
remove_empty_header_and_footer_lines_in_function = true
162+
[{remove_expression_list_finish_comma-eq-true.lua}]
163+
remove_expression_list_finish_comma = true
160164
[{minLine-eq-1.lua}]
161165
keep_line_after_if_statement = minLine:1
162166
keep_line_after_do_statement = minLine:1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
local f = function()
2+
3+
end
4+
5+
local function f2()
6+
-- body
7+
end
8+
9+
local function f3()
10+
-- body
11+
end
12+
13+
local function f4()
14+
local t = 13
15+
end
16+
17+
local function f5()
18+
f4(function()
19+
local d = 13
20+
end)
21+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--extend syntax
2+
local function f2(aaa, bbb, ccc)
3+
end
4+
5+
f2(1, 2, 3)

Test/test_script/format_text/wait_format_should_be/function.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ function f3()
2121
end
2222

2323
local dd = function()
24+
2425
local t = 13
26+
2527
end
2628

2729
--extend syntax
28-
local function f2(aaa, bbb, ccc)
30+
local function f2(aaa, bbb, ccc,)
2931
end
3032

31-
f2(1, 2, 3)
33+
f2(1, 2, 3,)

lua.template.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ table_append_expression_no_space = false
5050
if_condition_align_with_each_other = false
5151

5252
long_chain_expression_allow_one_space_after_colon = false
53+
54+
remove_empty_header_and_footer_lines_in_function = true
55+
56+
remove_expression_list_finish_comma = true
5357
# optional crlf/lf/cr/auto, if it is 'auto', in windows it is crlf other platforms are lf
5458
end_of_line = auto
5559
#

0 commit comments

Comments
 (0)