|
| 1 | +# see https://github.com/CppCXY/EmmyLuaCodeStyle |
| 2 | +[*.lua] |
| 3 | +# [basic code reformat option] |
| 4 | +# optional space/tab |
| 5 | +indent_style = space |
| 6 | +# if indent_style is space, this is valid |
| 7 | +indent_size = 4 |
| 8 | +# if indent_style is tab, this is valid |
| 9 | +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 = crlf |
| 47 | + |
| 48 | +# [line layout] |
| 49 | +# The following configuration supports three expressions |
| 50 | +# minLine:${n} |
| 51 | +# keepLine |
| 52 | +# KeepLine:${n} |
| 53 | + |
| 54 | +keep_line_after_if_statement = minLine:0 |
| 55 | +keep_line_after_do_statement = minLine:0 |
| 56 | +keep_line_after_while_statement = minLine:0 |
| 57 | +keep_line_after_repeat_statement = minLine:0 |
| 58 | +keep_line_after_for_statement = minLine:0 |
| 59 | +keep_line_after_local_or_assign_statement = keepLine |
| 60 | +keep_line_after_function_define_statement = keepLine:1 |
| 61 | + |
| 62 | +# [diagnostic] |
| 63 | +# the following is code diagnostic options |
| 64 | +enable_check_codestyle = true |
| 65 | +# this mean utf8 length |
| 66 | +max_line_length = 120 |
| 67 | +# this will check text end with new line(format always end with new line) |
| 68 | +insert_final_newline = true |
| 69 | + |
| 70 | +# [name style check] |
| 71 | +enable_name_style_check = true |
| 72 | +# the following is name style check rule |
| 73 | +# base option off/camel_case/snake_case/upper_snake_case/pascal_case/same(filename/first_param/'<const string>', snake_case/pascal_case/camel_case) |
| 74 | +# all option can use '|' represent or |
| 75 | +# for example: |
| 76 | +# snake_case | upper_snake_case |
| 77 | +# same(first_param, snake_case) |
| 78 | +# same('m') |
| 79 | +local_name_define_style = camel_case |
| 80 | +function_param_name_style = camel_case |
| 81 | +function_name_define_style = camel_case |
| 82 | +local_function_name_define_style = camel_case |
| 83 | +table_field_name_define_style = camel_case |
| 84 | +global_variable_name_define_style = camel_case|upper_snake_case |
| 85 | +module_name_define_style = camel_case |
| 86 | +require_module_name_style = camel_case |
| 87 | +class_name_define_style = camel_case |
0 commit comments