|
| 1 | +# see https://github.com/CppCXY/EmmyLuaCodeStyle |
| 2 | +[*.lua] |
| 3 | +# [basic] |
| 4 | +# optional space/tab |
| 5 | +indent_style = space |
| 6 | +# if indent_style is space, this is valid |
| 7 | +indent_size = 2 |
| 8 | +# if indent_style is tab, this is valid |
| 9 | +tab_width = 2 |
| 10 | +# none/single/double |
| 11 | +quote_style = double |
| 12 | +# only support number |
| 13 | +continuation_indent_size = 4 |
| 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 |
| 18 | + |
| 19 | +# this mean utf8 length , if this is 'unset' then the line width is no longer checked |
| 20 | +# this option decides when to chopdown the code |
| 21 | +max_line_length = 100 |
| 22 | + |
| 23 | +# this will check text end with new line |
| 24 | +insert_final_newline = true |
| 25 | + |
| 26 | +# [function] |
| 27 | + |
| 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 |
| 31 | + |
| 32 | +# if true, all function define params will align to first param |
| 33 | +align_function_define_params = true |
| 34 | + |
| 35 | +remove_expression_list_finish_comma = true |
| 36 | + |
| 37 | +# keep/remove/remove_table_only/remove_string_only/unambiguous_remove_string_only |
| 38 | +call_arg_parentheses = keep |
| 39 | + |
| 40 | +# [table] |
| 41 | + |
| 42 | +#optional none/comma/semicolon |
| 43 | +table_separator_style = none |
| 44 | + |
| 45 | +#optional keep/never/always/smart |
| 46 | +trailing_table_separator = keep |
| 47 | + |
| 48 | +# see document for detail |
| 49 | +continuous_assign_table_field_align_to_equal_sign = true |
| 50 | + |
| 51 | +# if true, format like this "local t = { 1, 2, 3 }" |
| 52 | +keep_one_space_between_table_and_bracket = true |
| 53 | + |
| 54 | +# if indent_style is tab, this option is invalid |
| 55 | +align_table_field_to_first_field = false |
| 56 | + |
| 57 | +# [statement] |
| 58 | + |
| 59 | +align_chained_expression_statement = false |
| 60 | + |
| 61 | +# continous line distance |
| 62 | +max_continuous_line_distance = 1 |
| 63 | + |
| 64 | +# see document for detail |
| 65 | +continuous_assign_statement_align_to_equal_sign = true |
| 66 | + |
| 67 | +# if statement will align like switch case |
| 68 | +if_condition_align_with_each_other = false |
| 69 | + |
| 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 |
| 73 | + |
| 74 | +statement_inline_comment_space = 1 |
| 75 | + |
| 76 | +# [indentation] |
| 77 | + |
| 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 |
| 84 | + |
| 85 | +if_branch_comments_after_block_no_indent = false |
| 86 | + |
| 87 | +# [space] |
| 88 | + |
| 89 | +# if true, t[#t+1] will not space wrapper '+' |
| 90 | +table_append_expression_no_space = false |
| 91 | + |
| 92 | +long_chain_expression_allow_one_space_after_colon = false |
| 93 | + |
| 94 | +remove_empty_header_and_footer_lines_in_function = true |
| 95 | + |
| 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 |
| 101 | + |
| 102 | +# if true, ormat like this "local t <const> = 1" |
| 103 | +keep_one_space_between_namedef_and_attribute = true |
| 104 | + |
| 105 | +# [row_layout] |
| 106 | +# 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 = false |
| 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) |
0 commit comments