reek 6.1.0 → 6.3.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 +76 -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reek
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 6.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Rutherford
@@ -11,36 +11,36 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2022-01-14 00:00:00.000000000 Z
14
+ date: 2024-01-28 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: kwalify
17
+ name: dry-schema
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: 0.7.0
22
+ version: 1.13.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 0.7.0
29
+ version: 1.13.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: parser
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - "~>"
35
35
  - !ruby/object:Gem::Version
36
- version: 3.1.0
36
+ version: 3.3.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: 3.1.0
43
+ version: 3.3.0
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: rainbow
46
46
  requirement: !ruby/object:Gem::Requirement
@@ -61,6 +61,20 @@ dependencies:
61
61
  - - "<"
62
62
  - !ruby/object:Gem::Version
63
63
  version: '4.0'
64
+ - !ruby/object:Gem::Dependency
65
+ name: rexml
66
+ requirement: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '3.1'
71
+ type: :runtime
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '3.1'
64
78
  description: Reek is a tool that examines Ruby classes, modules and methods and reports
65
79
  any code smells it finds.
66
80
  email:
@@ -124,6 +138,12 @@ files:
124
138
  - lib/reek/cli/options.rb
125
139
  - lib/reek/cli/silencer.rb
126
140
  - lib/reek/cli/status.rb
141
+ - lib/reek/code_climate.rb
142
+ - lib/reek/code_climate/code_climate_configuration.rb
143
+ - lib/reek/code_climate/code_climate_configuration.yml
144
+ - lib/reek/code_climate/code_climate_fingerprint.rb
145
+ - lib/reek/code_climate/code_climate_formatter.rb
146
+ - lib/reek/code_climate/code_climate_report.rb
127
147
  - lib/reek/code_comment.rb
128
148
  - lib/reek/configuration/app_configuration.rb
129
149
  - lib/reek/configuration/configuration_converter.rb
@@ -133,7 +153,7 @@ files:
133
153
  - lib/reek/configuration/directory_directives.rb
134
154
  - lib/reek/configuration/excluded_paths.rb
135
155
  - lib/reek/configuration/rake_task_converter.rb
136
- - lib/reek/configuration/schema.yml
156
+ - lib/reek/configuration/schema.rb
137
157
  - lib/reek/configuration/schema_validator.rb
138
158
  - lib/reek/context/attribute_context.rb
139
159
  - lib/reek/context/class_context.rb
@@ -165,12 +185,6 @@ files:
165
185
  - lib/reek/rake/task.rb
166
186
  - lib/reek/report.rb
167
187
  - lib/reek/report/base_report.rb
168
- - lib/reek/report/code_climate.rb
169
- - lib/reek/report/code_climate/code_climate_configuration.rb
170
- - lib/reek/report/code_climate/code_climate_configuration.yml
171
- - lib/reek/report/code_climate/code_climate_fingerprint.rb
172
- - lib/reek/report/code_climate/code_climate_formatter.rb
173
- - lib/reek/report/code_climate/code_climate_report.rb
174
188
  - lib/reek/report/documentation_link_warning_formatter.rb
175
189
  - lib/reek/report/heading_formatter.rb
176
190
  - lib/reek/report/html_report.rb
@@ -256,14 +270,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
256
270
  requirements:
257
271
  - - ">="
258
272
  - !ruby/object:Gem::Version
259
- version: 2.6.0
273
+ version: 3.0.0
260
274
  required_rubygems_version: !ruby/object:Gem::Requirement
261
275
  requirements:
262
276
  - - ">="
263
277
  - !ruby/object:Gem::Version
264
278
  version: '0'
265
279
  requirements: []
266
- rubygems_version: 3.3.3
280
+ rubygems_version: 3.3.26
267
281
  signing_key:
268
282
  specification_version: 4
269
283
  summary: Code smell detector for Ruby
@@ -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