@@ -13,105 +13,118 @@ set_rulesets(RuleSets) ->
13
13
-spec rules (Group :: atom ()) -> [elvis_core :rule ()].
14
14
rules (hrl_files ) ->
15
15
lists :map (fun ({Mod , Rule }) -> {Mod , Rule , apply (Mod , default , [Rule ])} end ,
16
- [{elvis_text_style , line_length },
17
- { elvis_text_style , no_tabs },
18
- { elvis_text_style , no_trailing_whitespace },
19
- { elvis_style , macro_names } ,
20
- { elvis_style , macro_module_names } ,
21
- { elvis_style , no_block_expressions } ,
22
- { elvis_style , operator_spaces } ,
23
- { elvis_style , no_space_after_pound } ,
24
- { elvis_style , no_space } ,
25
- { elvis_style , nesting_level } ,
26
- { elvis_style , no_if_expression } ,
27
- { elvis_style , used_ignored_variable } ,
28
- { elvis_style , no_behavior_info } ,
29
- { elvis_style , no_debug_call } ,
30
- { elvis_style , variable_naming_convention } ,
31
- { elvis_style , consistent_variable_casing } ,
32
- { elvis_style , no_nested_try_catch } ,
33
- { elvis_style , no_successive_maps } ,
34
- { elvis_style , atom_naming_convention } ,
35
- { elvis_style , no_throw } ,
36
- { elvis_style , no_dollar_space } ,
37
- { elvis_style , no_author } ,
38
- { elvis_style , no_import } ,
39
- { elvis_style , no_catch_expressions } ,
40
- { elvis_style , no_single_clause_case } ,
41
- { elvis_style , no_match_in_condition } ,
42
- { elvis_style , numeric_format } ,
43
- { elvis_style , no_specs } ,
44
- { elvis_style , no_types } ]);
16
+ [{elvis_text_style , Rule } || Rule <- [ line_length , no_tabs , no_trailing_whitespace ]]
17
+ ++ [{ elvis_style , Rule }
18
+ || Rule
19
+ <- [ atom_naming_convention ,
20
+ consistent_variable_casing ,
21
+ macro_module_names ,
22
+ macro_names ,
23
+ nesting_level ,
24
+ no_author ,
25
+ no_behavior_info ,
26
+ no_block_expressions ,
27
+ no_catch_expressions ,
28
+ no_debug_call ,
29
+ no_dollar_space ,
30
+ no_if_expression ,
31
+ no_import ,
32
+ no_match_in_condition ,
33
+ no_nested_try_catch ,
34
+ no_single_clause_case ,
35
+ no_space ,
36
+ no_space_after_pound ,
37
+ no_specs ,
38
+ no_successive_maps ,
39
+ no_throw ,
40
+ no_types ,
41
+ numeric_format ,
42
+ operator_spaces ,
43
+ used_ignored_variable ,
44
+ variable_naming_convention ] ]);
45
45
rules (erl_files ) ->
46
46
lists :map (fun ({Mod , Rule }) -> {Mod , Rule , apply (Mod , default , [Rule ])} end ,
47
- [{elvis_text_style , line_length },
48
- {elvis_text_style , no_tabs },
49
- {elvis_text_style , no_trailing_whitespace },
50
- {elvis_style , macro_names },
51
- {elvis_style , macro_module_names },
52
- {elvis_style , no_block_expressions },
53
- {elvis_style , operator_spaces },
54
- {elvis_style , no_space_after_pound },
55
- {elvis_style , no_space },
56
- {elvis_style , nesting_level },
57
- {elvis_style , god_modules },
58
- {elvis_style , no_if_expression },
59
- {elvis_style , invalid_dynamic_call },
60
- {elvis_style , used_ignored_variable },
61
- {elvis_style , no_behavior_info },
62
- {elvis_style , module_naming_convention },
63
- {elvis_style , function_naming_convention },
64
- {elvis_style , no_spec_with_records },
65
- {elvis_style , dont_repeat_yourself },
66
- {elvis_style , no_debug_call },
67
- {elvis_style , variable_naming_convention },
68
- {elvis_style , consistent_variable_casing },
69
- {elvis_style , no_nested_try_catch },
70
- {elvis_style , no_successive_maps },
71
- {elvis_style , atom_naming_convention },
72
- {elvis_style , no_throw },
73
- {elvis_style , no_dollar_space },
74
- {elvis_style , no_author },
75
- {elvis_style , no_import },
76
- {elvis_style , no_catch_expressions },
77
- {elvis_style , no_single_clause_case },
78
- {elvis_style , no_match_in_condition },
79
- {elvis_style , numeric_format },
80
- {elvis_style , behaviour_spelling },
81
- {elvis_style , export_used_types },
82
- {elvis_style , max_function_arity },
83
- {elvis_style , max_anonymous_function_arity },
84
- {elvis_style , param_pattern_matching },
85
- {elvis_style , private_data_types }]);
47
+ [{elvis_text_style , Rule } || Rule <- [line_length , no_tabs , no_trailing_whitespace ]]
48
+ ++ [{elvis_style , Rule }
49
+ || Rule
50
+ <- [atom_naming_convention ,
51
+ behaviour_spelling ,
52
+ consistent_variable_casing ,
53
+ dont_repeat_yourself ,
54
+ export_used_types ,
55
+ function_naming_convention ,
56
+ god_modules ,
57
+ invalid_dynamic_call ,
58
+ macro_module_names ,
59
+ macro_names ,
60
+ max_anonymous_function_arity ,
61
+ max_function_arity ,
62
+ module_naming_convention ,
63
+ nesting_level ,
64
+ no_author ,
65
+ no_behavior_info ,
66
+ no_block_expressions ,
67
+ no_catch_expressions ,
68
+ no_debug_call ,
69
+ no_dollar_space ,
70
+ no_if_expression ,
71
+ no_import ,
72
+ no_match_in_condition ,
73
+ no_nested_try_catch ,
74
+ no_single_clause_case ,
75
+ no_space ,
76
+ no_space_after_pound ,
77
+ no_spec_with_records ,
78
+ no_successive_maps ,
79
+ no_throw ,
80
+ numeric_format ,
81
+ operator_spaces ,
82
+ param_pattern_matching ,
83
+ private_data_types ,
84
+ used_ignored_variable ,
85
+ variable_naming_convention ]]);
86
+ rules (erl_files_strict ) ->
87
+ rules (erl_files )
88
+ ++ lists :map (fun ({Mod , Rule }) -> {Mod , Rule , apply (Mod , default , [Rule ])} end ,
89
+ [{elvis_style , Rule }
90
+ || Rule
91
+ <- [always_shortcircuit ,
92
+ consistent_generic_type ,
93
+ max_function_length ,
94
+ max_module_length ,
95
+ no_call ,
96
+ no_common_caveats_call ,
97
+ no_macros ,
98
+ state_record_and_type ]]);
86
99
rules (beam_files ) ->
87
100
lists :map (fun (Rule ) -> {elvis_style , Rule , elvis_style :default (Rule )} end ,
88
- [nesting_level ,
101
+ [atom_naming_convention ,
102
+ behaviour_spelling ,
103
+ consistent_variable_casing ,
104
+ dont_repeat_yourself ,
105
+ export_used_types ,
106
+ function_naming_convention ,
89
107
god_modules ,
90
- no_if_expression ,
91
108
invalid_dynamic_call ,
92
- used_ignored_variable ,
109
+ max_anonymous_function_arity ,
110
+ max_function_arity ,
93
111
module_naming_convention ,
94
- function_naming_convention ,
95
- no_spec_with_records ,
96
- dont_repeat_yourself ,
112
+ nesting_level ,
113
+ no_author ,
114
+ no_catch_expressions ,
97
115
no_debug_call ,
98
- variable_naming_convention ,
99
- consistent_variable_casing ,
116
+ no_if_expression ,
117
+ no_import ,
118
+ no_match_in_condition ,
100
119
no_nested_try_catch ,
120
+ no_single_clause_case ,
121
+ no_spec_with_records ,
101
122
no_successive_maps ,
102
- atom_naming_convention ,
103
123
no_throw ,
104
- no_author ,
105
- no_import ,
106
- no_catch_expressions ,
107
- no_single_clause_case ,
108
- no_match_in_condition ,
109
- behaviour_spelling ,
110
- export_used_types ,
111
- max_function_arity ,
112
- max_anonymous_function_arity ,
113
124
param_pattern_matching ,
114
- private_data_types ]);
125
+ private_data_types ,
126
+ used_ignored_variable ,
127
+ variable_naming_convention ]);
115
128
rules (rebar_config ) ->
116
129
lists :map (fun (Rule ) -> {elvis_project , Rule , elvis_project :default (Rule )} end ,
117
130
[no_branch_deps , protocol_for_deps ]);
0 commit comments