|
| 1 | + |
1 | 2 | # see https://github.com/CppCXY/EmmyLuaCodeStyle
|
2 | 3 | [*.lua]
|
3 |
| -# [basic code reformat option] |
| 4 | +# [basic] |
| 5 | + |
4 | 6 | # optional space/tab
|
5 | 7 | indent_style = space
|
6 | 8 | # if indent_style is space, this is valid
|
7 | 9 | indent_size = 4
|
8 | 10 | # if indent_style is tab, this is valid
|
9 | 11 | 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 |
67 | 19 | 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 |
69 | 34 | insert_final_newline = true
|
70 | 35 |
|
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 |
0 commit comments