reek 6.1.0 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +4 -0
  3. data/.github/workflows/ruby.yml +7 -7
  4. data/.rubocop.yml +2 -10
  5. data/CHANGELOG.md +69 -0
  6. data/CONTRIBUTING.md +7 -10
  7. data/Gemfile +7 -6
  8. data/README.md +28 -28
  9. data/bin/code_climate_reek +54 -5
  10. data/lib/reek/ast/sexp_extensions/arguments.rb +9 -0
  11. data/lib/reek/ast/sexp_extensions/send.rb +21 -6
  12. data/lib/reek/cli/command/todo_list_command.rb +2 -2
  13. data/lib/reek/cli/options.rb +5 -5
  14. data/lib/reek/{report/code_climate → code_climate}/code_climate_configuration.rb +1 -1
  15. data/lib/reek/{report/code_climate → code_climate}/code_climate_configuration.yml +41 -41
  16. data/lib/reek/{report/code_climate → code_climate}/code_climate_fingerprint.rb +2 -2
  17. data/lib/reek/{report/code_climate → code_climate}/code_climate_formatter.rb +1 -1
  18. data/lib/reek/{report/code_climate → code_climate}/code_climate_report.rb +3 -3
  19. data/lib/reek/code_comment.rb +3 -3
  20. data/lib/reek/configuration/app_configuration.rb +5 -5
  21. data/lib/reek/configuration/configuration_converter.rb +1 -1
  22. data/lib/reek/configuration/configuration_file_finder.rb +5 -4
  23. data/lib/reek/configuration/default_directive.rb +1 -1
  24. data/lib/reek/configuration/directory_directives.rb +1 -1
  25. data/lib/reek/configuration/excluded_paths.rb +1 -1
  26. data/lib/reek/configuration/schema.rb +177 -0
  27. data/lib/reek/configuration/schema_validator.rb +12 -13
  28. data/lib/reek/context/attribute_context.rb +1 -1
  29. data/lib/reek/context/method_context.rb +1 -1
  30. data/lib/reek/context/module_context.rb +4 -0
  31. data/lib/reek/context/send_context.rb +7 -1
  32. data/lib/reek/documentation_link.rb +3 -5
  33. data/lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb +2 -2
  34. data/lib/reek/errors/bad_detector_in_comment_error.rb +2 -2
  35. data/lib/reek/errors/encoding_error.rb +1 -1
  36. data/lib/reek/errors/garbage_detector_configuration_in_comment_error.rb +2 -2
  37. data/lib/reek/errors/incomprehensible_source_error.rb +1 -1
  38. data/lib/reek/errors/legacy_comment_separator_error.rb +2 -2
  39. data/lib/reek/errors/syntax_error.rb +1 -1
  40. data/lib/reek/rake/task.rb +5 -5
  41. data/lib/reek/smell_detectors/class_variable.rb +2 -2
  42. data/lib/reek/smell_detectors/control_parameter_helpers/candidate.rb +6 -6
  43. data/lib/reek/smell_detectors/control_parameter_helpers/control_parameter_finder.rb +1 -1
  44. data/lib/reek/smell_detectors/duplicate_method_call.rb +5 -5
  45. data/lib/reek/smell_detectors/instance_variable_assumption.rb +8 -8
  46. data/lib/reek/smell_detectors/nested_iterators.rb +4 -3
  47. data/lib/reek/smell_detectors/unused_private_method.rb +3 -2
  48. data/lib/reek/spec/should_reek_of.rb +7 -7
  49. data/lib/reek/spec.rb +1 -1
  50. data/lib/reek/version.rb +1 -1
  51. data/reek.gemspec +4 -3
  52. metadata +30 -16
  53. data/lib/reek/configuration/schema.yml +0 -210
  54. /data/lib/reek/{report/code_climate.rb → code_climate.rb} +0 -0
@@ -1,210 +0,0 @@
1
- ---
2
- type: map
3
- mapping:
4
- "detectors":
5
- type: map
6
- mapping: &all_detectors
7
- Attribute:
8
- type: map
9
- mapping: &detector_base
10
- "enabled":
11
- type: bool
12
- "exclude":
13
- type: seq
14
- sequence:
15
- - type: str
16
- BooleanParameter:
17
- type: map
18
- mapping:
19
- <<: *detector_base
20
- ClassVariable:
21
- type: map
22
- mapping:
23
- <<: *detector_base
24
- ControlParameter:
25
- type: map
26
- mapping:
27
- <<: *detector_base
28
- DataClump:
29
- type: map
30
- mapping:
31
- <<: *detector_base
32
- max_copies:
33
- type: number
34
- min_clump_size:
35
- type: number
36
- DuplicateMethodCall:
37
- type: map
38
- mapping:
39
- <<: *detector_base
40
- max_calls:
41
- type: number
42
- allow_calls:
43
- type: seq
44
- sequence:
45
- - type: str
46
- FeatureEnvy:
47
- type: map
48
- mapping:
49
- <<: *detector_base
50
- InstanceVariableAssumption:
51
- type: map
52
- mapping:
53
- <<: *detector_base
54
- IrresponsibleModule:
55
- type: map
56
- mapping:
57
- <<: *detector_base
58
- LongParameterList:
59
- type: map
60
- mapping:
61
- <<: *detector_base
62
- max_params:
63
- type: number
64
- overrides:
65
- type: map
66
- mapping:
67
- initialize:
68
- type: map
69
- mapping:
70
- max_params:
71
- type: number
72
- LongYieldList:
73
- type: map
74
- mapping:
75
- <<: *detector_base
76
- max_params:
77
- type: number
78
- ManualDispatch:
79
- type: map
80
- mapping:
81
- <<: *detector_base
82
- MissingSafeMethod:
83
- type: map
84
- mapping:
85
- <<: *detector_base
86
- ModuleInitialize:
87
- type: map
88
- mapping:
89
- <<: *detector_base
90
- NestedIterators:
91
- type: map
92
- mapping:
93
- <<: *detector_base
94
- max_allowed_nesting:
95
- type: number
96
- ignore_iterators:
97
- type: seq
98
- sequence:
99
- - type: str
100
- NilCheck:
101
- type: map
102
- mapping:
103
- <<: *detector_base
104
- RepeatedConditional:
105
- type: map
106
- mapping:
107
- <<: *detector_base
108
- max_ifs:
109
- type: number
110
- SubclassedFromCoreClass:
111
- type: map
112
- mapping:
113
- <<: *detector_base
114
- Syntax:
115
- type: map
116
- mapping:
117
- <<: *detector_base
118
- TooManyConstants:
119
- type: map
120
- mapping:
121
- <<: *detector_base
122
- max_constants:
123
- type: number
124
- TooManyInstanceVariables:
125
- type: map
126
- mapping:
127
- <<: *detector_base
128
- max_instance_variables:
129
- type: number
130
- TooManyMethods:
131
- type: map
132
- mapping:
133
- <<: *detector_base
134
- max_methods:
135
- type: number
136
- TooManyStatements:
137
- type: map
138
- mapping:
139
- <<: *detector_base
140
- max_statements:
141
- type: number
142
- UncommunicativeMethodName:
143
- type: map
144
- mapping:
145
- <<: *detector_base
146
- reject: &reject_settings
147
- type: seq
148
- sequence:
149
- - type: str
150
- accept: &accept_settings
151
- type: seq
152
- sequence:
153
- - type: str
154
- UncommunicativeModuleName:
155
- type: map
156
- mapping:
157
- <<: *detector_base
158
- reject: *reject_settings
159
- accept: *accept_settings
160
- UncommunicativeParameterName:
161
- type: map
162
- mapping:
163
- <<: *detector_base
164
- reject: *reject_settings
165
- accept: *accept_settings
166
- UncommunicativeVariableName:
167
- type: map
168
- mapping:
169
- <<: *detector_base
170
- reject: *reject_settings
171
- accept: *accept_settings
172
- UnusedParameters:
173
- type: map
174
- mapping:
175
- <<: *detector_base
176
- UnusedPrivateMethod:
177
- type: map
178
- mapping:
179
- <<: *detector_base
180
- UtilityFunction:
181
- type: map
182
- mapping:
183
- <<: *detector_base
184
- public_methods_only:
185
- type: bool
186
-
187
- "directories":
188
- type: map
189
- mapping:
190
- # For any given key that is not matched somewhere else we'll apply the schema below.
191
- # So this will just slurp in every directory we throw at it and then validate everything under
192
- # it against all detectors - for instance:
193
- #
194
- # directories:
195
- # "web_app/app/controllers":
196
- # NestedIterators:
197
- # enabled: false
198
- # "web_app/app/helpers":
199
- # UtilityFunction:
200
- # enabled: false
201
- #
202
- # For details check out: http://www.kuwata-lab.com/kwalify/ruby/users-guide.02.html#tips-default
203
- =:
204
- type: map
205
- mapping: *all_detectors
206
-
207
- "exclude_paths":
208
- type: seq
209
- sequence:
210
- - type: str