|
6 | 6 |
|
7 | 7 | LuaCodeStyleOptions::LuaCodeStyleOptions() |
8 | 8 | : |
9 | | - keep_line_after_if_statement(nullptr), |
10 | | - keep_line_after_do_statement(nullptr), |
11 | | - keep_line_after_while_statement(nullptr), |
12 | | - keep_line_after_repeat_statement(nullptr), |
13 | | - keep_line_after_for_statement(nullptr), |
14 | | - keep_line_after_local_or_assign_statement(nullptr), |
15 | | - keep_line_after_function_define_statement(nullptr), |
| 9 | + keep_line_after_if_statement(std::make_shared<MinLineElement>(1)), |
| 10 | + keep_line_after_do_statement(std::make_shared<MinLineElement>(1)), |
| 11 | + keep_line_after_while_statement(std::make_shared<MinLineElement>(1)), |
| 12 | + keep_line_after_repeat_statement(std::make_shared<MinLineElement>(1)), |
| 13 | + keep_line_after_for_statement(std::make_shared<MinLineElement>(1)), |
| 14 | + keep_line_after_local_or_assign_statement(std::make_shared<KeepLineElement>()), |
| 15 | + keep_line_after_function_define_statement(std::make_shared<KeepLineElement>(1)), |
16 | 16 |
|
17 | | - local_name_define_style(nullptr), |
18 | | - function_name_define_style(nullptr), |
19 | | - table_field_name_define_style(nullptr), |
20 | | - global_variable_name_define_style(nullptr), |
21 | | - module_name_define_style(nullptr), |
22 | | - require_module_name_style(nullptr), |
23 | | - class_name_define_style(nullptr) |
| 17 | + local_name_define_style(std::make_shared<NameStyleRuleMatcher>()), |
| 18 | + function_param_name_style(std::make_shared<NameStyleRuleMatcher>()), |
| 19 | + function_name_define_style(std::make_shared<NameStyleRuleMatcher>()), |
| 20 | + local_function_name_define_style(std::make_shared<NameStyleRuleMatcher>()), |
| 21 | + table_field_name_define_style(std::make_shared<NameStyleRuleMatcher>()), |
| 22 | + global_variable_name_define_style(std::make_shared<NameStyleRuleMatcher>()), |
| 23 | + module_name_define_style(std::make_shared<NameStyleRuleMatcher>()), |
| 24 | + require_module_name_style(std::make_shared<NameStyleRuleMatcher>()), |
| 25 | + class_name_define_style(std::make_shared<NameStyleRuleMatcher>()) |
24 | 26 | { |
25 | | - SetDefault(); |
26 | | -} |
27 | | - |
28 | | -void LuaCodeStyleOptions::SetDefault() |
29 | | -{ |
30 | | - keep_line_after_if_statement = std::make_shared<MinLineElement>(1); |
31 | | - keep_line_after_do_statement = std::make_shared<MinLineElement>(1); |
32 | | - keep_line_after_while_statement = std::make_shared<MinLineElement>(1); |
33 | | - keep_line_after_repeat_statement = std::make_shared<MinLineElement>(1); |
34 | | - keep_line_after_for_statement = std::make_shared<MinLineElement>(1); |
35 | | - keep_line_after_local_or_assign_statement = std::make_shared<KeepLineElement>(); |
36 | | - keep_line_after_function_define_statement = std::make_shared<KeepLineElement>(1); |
37 | | - |
38 | | - local_name_define_style = std::make_shared<NameStyleRuleMatcher>(); |
39 | | - function_name_define_style = std::make_shared<NameStyleRuleMatcher>(); |
40 | | - table_field_name_define_style = std::make_shared<NameStyleRuleMatcher>(); |
41 | | - global_variable_name_define_style = std::make_shared<NameStyleRuleMatcher>(); |
42 | | - module_name_define_style = std::make_shared<NameStyleRuleMatcher>(); |
43 | | - require_module_name_style = std::make_shared<NameStyleRuleMatcher>(); |
44 | | - class_name_define_style = std::make_shared<NameStyleRuleMatcher>(); |
45 | 27 | } |
0 commit comments