reek 4.8.1 → 4.8.2

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/README.md +3 -3
  4. data/docs/Instance-Variable-Assumption.md +1 -1
  5. data/docs/Uncommunicative-Method-Name.md +2 -2
  6. data/docs/Uncommunicative-Module-Name.md +1 -1
  7. data/docs/Uncommunicative-Parameter-Name.md +1 -1
  8. data/features/command_line_interface/basic_usage.feature +2 -2
  9. data/features/command_line_interface/options.feature +1 -1
  10. data/features/command_line_interface/show_progress.feature +4 -4
  11. data/features/command_line_interface/smell_selection.feature +1 -1
  12. data/features/command_line_interface/smells_count.feature +6 -6
  13. data/features/command_line_interface/stdin.feature +5 -5
  14. data/features/configuration_files/accept_setting.feature +6 -6
  15. data/features/configuration_files/directory_specific_directives.feature +20 -20
  16. data/features/configuration_files/exclude_directives.feature +3 -3
  17. data/features/configuration_files/exclude_paths_directives.feature +4 -4
  18. data/features/configuration_files/masking_smells.feature +4 -4
  19. data/features/configuration_files/mix_accept_reject_setting.feature +7 -7
  20. data/features/configuration_files/reject_setting.feature +12 -12
  21. data/features/configuration_files/unused_private_method.feature +4 -4
  22. data/features/configuration_loading.feature +3 -3
  23. data/features/configuration_via_source_comments/erroneous_source_comments.feature +2 -2
  24. data/features/configuration_via_source_comments/well_formed_source_comments.feature +2 -2
  25. data/features/locales.feature +2 -2
  26. data/features/rake_task/rake_task.feature +15 -15
  27. data/features/reports/json.feature +1 -4
  28. data/features/reports/reports.feature +26 -26
  29. data/features/reports/yaml.feature +0 -3
  30. data/features/samples.feature +287 -287
  31. data/features/support/env.rb +2 -2
  32. data/features/todo_list.feature +10 -10
  33. data/lib/reek/cli/options.rb +2 -1
  34. data/lib/reek/documentation_link.rb +28 -0
  35. data/lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb +3 -2
  36. data/lib/reek/errors/bad_detector_in_comment_error.rb +3 -2
  37. data/lib/reek/errors/garbage_detector_configuration_in_comment_error.rb +3 -2
  38. data/lib/reek/report/code_climate/code_climate_configuration.yml +1 -1
  39. data/lib/reek/report/formatter/wiki_link_warning_formatter.rb +2 -15
  40. data/lib/reek/smell_detectors/feature_envy.rb +1 -0
  41. data/lib/reek/smell_warning.rb +5 -0
  42. data/lib/reek/version.rb +1 -1
  43. data/spec/reek/documentation_link_spec.rb +20 -0
  44. data/spec/reek/report/json_report_spec.rb +2 -2
  45. data/spec/reek/report/yaml_report_spec.rb +2 -2
  46. data/spec/reek/smell_detectors/feature_envy_spec.rb +45 -0
  47. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d66c9a36e561c26a8a5cd27af9780ded54de1fdfe9b00b289701027403330b3
4
- data.tar.gz: 592050ff0e9af5744467c2299cb085246059fbdc96358dbadbad68a0f2e36763
3
+ metadata.gz: 8688a1d76cc81f34b630798bdd47068e760e4a397548747194edb5e6bb42d255
4
+ data.tar.gz: 850489fdbab5642d489eebae9427c5028dff6093f29551f322a44201ace1142e
5
5
  SHA512:
6
- metadata.gz: 431ee00e3a0021baa1c752d0a2393b84bdf873d7be702c428f57b1b538ff9dceb11957551674be4031ddd26d9ddb7aa9a01a00b84aa53cd1650f76f045243370
7
- data.tar.gz: 58c93de891eec497652eda081101a7b77a93eee296c4824b379beb4982de4064c9488d67fa9dd9fe2cfe822f428be305befd65a80b77fe5ec3eb2a4d428a3b5a
6
+ metadata.gz: 8dd0a801d1ea96549e942b90d1a8552786a0b6b4d9ef1febaec2abdeb77bc747ece35d31b3ca4cf97108a268e6b2edabb4e02959c2aed72cd3d4469d5d078b4d
7
+ data.tar.gz: 2d8f97017347131099c498b3dd744459bd0e7e729c29e4c274f4ed8cc5487b520402787c1ae7cc88d276597117a7ee1521cc496998ec7f805a644e0929b12bc8
@@ -1,5 +1,10 @@
1
1
  # Change log
2
2
 
3
+ ## 4.8.2 (2018-06-26)
4
+
5
+ * (mvz) Only report FeatureEnvy for instance methods
6
+ * (mvz) Generate versioned documentation links
7
+
3
8
  ## 4.8.1 (2018-04-12)
4
9
 
5
10
  * (mvz) Loosen dependency on rainbow
data/README.md CHANGED
@@ -84,13 +84,13 @@ end
84
84
  Reek will report the following code smells in this file:
85
85
 
86
86
  ```
87
- $ reek demo.rb
87
+ $ reek --no-wiki-links demo.rb
88
88
  Inspecting 1 file(s):
89
89
  S
90
90
 
91
91
  demo.rb -- 2 warnings:
92
- [4]:UncommunicativeMethodName: Smelly#x has the name 'x' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
93
- [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
92
+ [4]:UncommunicativeMethodName: Smelly#x has the name 'x'
93
+ [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y'
94
94
  ```
95
95
 
96
96
  ## Supported Ruby versions
@@ -61,7 +61,7 @@ end
61
61
  would report:
62
62
 
63
63
  ```Bash
64
- [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar [https://github.com/troessner/reek/blob/master/docs/Instance-Variable-Assumption.md]
64
+ [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar
65
65
  ```
66
66
 
67
67
  Note that this example would trigger this smell warning as well:
@@ -50,6 +50,6 @@ Reek would report:
50
50
 
51
51
  ```
52
52
  smelly.rb -- 2 warnings:
53
- [4]:UncommunicativeMethodName: awesome_helper has the name 'awesome_helper' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
54
- [3]:UncommunicativeMethodName: foobar has the name 'foobar' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
53
+ [4]:UncommunicativeMethodName: awesome_helper has the name 'awesome_helper'
54
+ [3]:UncommunicativeMethodName: foobar has the name 'foobar'
55
55
  ```
@@ -46,5 +46,5 @@ Reek would report:
46
46
 
47
47
  ```
48
48
  smelly.rb -- 1 warning:
49
- [3]:UncommunicativeModuleName: BaseHelper has the name 'BaseHelper' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Module-Name.md]
49
+ [3]:UncommunicativeModuleName: BaseHelper has the name 'BaseHelper'
50
50
  ```
@@ -48,5 +48,5 @@ Reek would report:
48
48
 
49
49
  ```
50
50
  smelly.rb -- 1 warning:
51
- [3]:UncommunicativeParameterName: omg has the parameter name 'foobar' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Parameter-Name.md]
51
+ [3]:UncommunicativeParameterName: omg has the parameter name 'foobar'
52
52
  ```
@@ -10,6 +10,6 @@ Feature: The Reek CLI maintains backwards compatibility
10
10
  And it reports:
11
11
  """
12
12
  smelly.rb -- 2 warnings:
13
- [4]:UncommunicativeMethodName: Smelly#x has the name 'x' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
14
- [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
13
+ [4]:UncommunicativeMethodName: Smelly#x has the name 'x'
14
+ [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y'
15
15
  """
@@ -43,7 +43,7 @@ Feature: Reek can be controlled using command-line options
43
43
  -c, --config FILE Read configuration options from FILE
44
44
  --smell SMELL Only look for a specific smell.
45
45
  Call it like this: reek --smell PrimaDonnaMethod source.rb
46
- Check out https://github.com/troessner/reek/blob/master/docs/Code-Smells.md for a list of smells
46
+ Check out https://github.com/troessner/reek/blob/v4.8.1/docs/Code-Smells.md for a list of smells
47
47
 
48
48
  Generate a todo list:
49
49
  -t, --todo Generate a todo list
@@ -15,8 +15,8 @@ Feature: Show progress
15
15
  .S
16
16
 
17
17
  mixed_files/dirty.rb -- 2 warnings:
18
- [4]:UncommunicativeMethodName: Smelly#x has the name 'x' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
19
- [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
18
+ [4]:UncommunicativeMethodName: Smelly#x has the name 'x'
19
+ [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y'
20
20
  2 total warnings
21
21
  """
22
22
 
@@ -27,7 +27,7 @@ Feature: Show progress
27
27
  And it reports:
28
28
  """
29
29
  mixed_files/dirty.rb -- 2 warnings:
30
- [4]:UncommunicativeMethodName: Smelly#x has the name 'x' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
31
- [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
30
+ [4]:UncommunicativeMethodName: Smelly#x has the name 'x'
31
+ [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y'
32
32
  2 total warnings
33
33
  """
@@ -11,5 +11,5 @@ Feature: Smell selection
11
11
  And it reports:
12
12
  """
13
13
  smelly.rb -- 1 warning:
14
- UncommunicativeVariableName: Smelly#x has the variable name 'y' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
14
+ UncommunicativeVariableName: Smelly#x has the variable name 'y'
15
15
  """
@@ -9,8 +9,8 @@ Feature: Reports total number of code smells
9
9
  And it reports:
10
10
  """
11
11
  smelly.rb -- 2 warnings:
12
- [4]:UncommunicativeMethodName: Smelly#x has the name 'x' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
13
- [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
12
+ [4]:UncommunicativeMethodName: Smelly#x has the name 'x'
13
+ [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y'
14
14
  """
15
15
 
16
16
  Scenario: Output total number of smells when inspecting multiple files
@@ -20,11 +20,11 @@ Feature: Reports total number of code smells
20
20
  And it reports:
21
21
  """
22
22
  smelly/dirty_one.rb -- 2 warnings:
23
- [4]:UncommunicativeMethodName: Smelly#x has the name 'x' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
24
- [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
23
+ [4]:UncommunicativeMethodName: Smelly#x has the name 'x'
24
+ [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y'
25
25
  smelly/dirty_two.rb -- 2 warnings:
26
- [4]:UncommunicativeMethodName: Smelly#x has the name 'x' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
27
- [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
26
+ [4]:UncommunicativeMethodName: Smelly#x has the name 'x'
27
+ [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y'
28
28
  4 total warnings
29
29
  """
30
30
 
@@ -27,9 +27,9 @@ Feature: Reek reads from $stdin when no files are given
27
27
  And it reports:
28
28
  """
29
29
  STDIN -- 3 warnings:
30
- [1]:IrresponsibleModule: Turn has no descriptive comment [https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md]
31
- [1]:UncommunicativeMethodName: Turn#y has the name 'y' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
32
- [1]:UncommunicativeVariableName: Turn has the variable name '@x' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
30
+ [1]:IrresponsibleModule: Turn has no descriptive comment
31
+ [1]:UncommunicativeMethodName: Turn#y has the name 'y'
32
+ [1]:UncommunicativeVariableName: Turn has the variable name '@x'
33
33
  """
34
34
 
35
35
  Scenario: syntax error causes the source to be ignored
@@ -38,6 +38,6 @@ Feature: Reek reads from $stdin when no files are given
38
38
  And it reports:
39
39
  """
40
40
  STDIN -- 2 warnings:
41
- [2]:Syntax: This file has unexpected token $end [https://github.com/troessner/reek/blob/master/docs/Syntax.md]
42
- [1]:Syntax: This file has unexpected token tEQL [https://github.com/troessner/reek/blob/master/docs/Syntax.md]
41
+ [2]:Syntax: This file has unexpected token $end
42
+ [1]:Syntax: This file has unexpected token tEQL
43
43
  """
@@ -30,12 +30,12 @@ Feature: `accept` configuration setting
30
30
  def m3(a3); a3; end
31
31
  end
32
32
  """
33
- When I run `reek -c config.reek smelly.rb`
33
+ When I run reek -c config.reek smelly.rb
34
34
  Then it reports:
35
35
  """
36
36
  smelly.rb -- 2 warnings:
37
- [8]:UncommunicativeMethodName: C1#m3 has the name 'm3' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
38
- [8]:UncommunicativeParameterName: C1#m3 has the parameter name 'a3' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Parameter-Name.md]
37
+ [8]:UncommunicativeMethodName: C1#m3 has the name 'm3'
38
+ [8]:UncommunicativeParameterName: C1#m3 has the parameter name 'a3'
39
39
  """
40
40
 
41
41
  Scenario: Accept regexes as list and as single item
@@ -61,10 +61,10 @@ Feature: `accept` configuration setting
61
61
  def m2(a2); a2; end
62
62
  end
63
63
  """
64
- When I run `reek -c config.reek smelly.rb`
64
+ When I run reek -c config.reek smelly.rb
65
65
  Then it reports:
66
66
  """
67
67
  smelly.rb -- 2 warnings:
68
- [6]:UncommunicativeMethodName: Classy1#m2 has the name 'm2' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
69
- [6]:UncommunicativeParameterName: Classy1#m2 has the parameter name 'a2' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Parameter-Name.md]
68
+ [6]:UncommunicativeMethodName: Classy1#m2 has the name 'm2'
69
+ [6]:UncommunicativeParameterName: Classy1#m2 has the parameter name 'a2'
70
70
  """
@@ -46,14 +46,14 @@ Feature: Directory directives
46
46
  end
47
47
  end
48
48
  """
49
- When I run `reek -c web_app/config.reek web_app/`
49
+ When I run reek -c web_app/config.reek web_app/
50
50
  Then it reports:
51
51
  """
52
52
  web_app/app/controllers/users_controller.rb -- 1 warning:
53
- [1]:InstanceVariableAssumption: UsersController assumes too much for instance variable '@user' [https://github.com/troessner/reek/blob/master/docs/Instance-Variable-Assumption.md]
53
+ [1]:InstanceVariableAssumption: UsersController assumes too much for instance variable '@user'
54
54
  web_app/app/models/user.rb -- 2 warnings:
55
- [1]:IrresponsibleModule: User has no descriptive comment [https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md]
56
- [2]:UnusedParameters: User#logged_in_with_role has unused parameter 'role' [https://github.com/troessner/reek/blob/master/docs/Unused-Parameters.md]
55
+ [1]:IrresponsibleModule: User has no descriptive comment
56
+ [2]:UnusedParameters: User#logged_in_with_role has unused parameter 'role'
57
57
  3 total warnings
58
58
  """
59
59
 
@@ -72,7 +72,7 @@ Feature: Directory directives
72
72
  end
73
73
  end
74
74
  """
75
- When I run `reek -c web_app/config.reek controllers`
75
+ When I run reek -c web_app/config.reek controllers
76
76
  Then it reports nothing
77
77
 
78
78
  Scenario: Partially mask smells in different directories
@@ -117,15 +117,15 @@ Feature: Directory directives
117
117
  end
118
118
  end
119
119
  """
120
- When I run `reek -c web_app/config.reek web_app/`
120
+ When I run reek -c web_app/config.reek web_app/
121
121
  Then it reports:
122
122
  """
123
123
  web_app/app/controllers/users_controller.rb -- 3 warnings:
124
- [1]:InstanceVariableAssumption: UsersController assumes too much for instance variable '@user' [https://github.com/troessner/reek/blob/master/docs/Instance-Variable-Assumption.md]
125
- [1]:IrresponsibleModule: UsersController has no descriptive comment [https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md]
126
- [4]:NestedIterators: UsersController#show contains iterators nested 2 deep [https://github.com/troessner/reek/blob/master/docs/Nested-Iterators.md]
124
+ [1]:InstanceVariableAssumption: UsersController assumes too much for instance variable '@user'
125
+ [1]:IrresponsibleModule: UsersController has no descriptive comment
126
+ [4]:NestedIterators: UsersController#show contains iterators nested 2 deep
127
127
  web_app/app/models/user.rb -- 1 warning:
128
- [2]:UnusedParameters: User#logged_in_with_role has unused parameter 'role' [https://github.com/troessner/reek/blob/master/docs/Unused-Parameters.md]
128
+ [2]:UnusedParameters: User#logged_in_with_role has unused parameter 'role'
129
129
  4 total warnings
130
130
  """
131
131
 
@@ -163,15 +163,15 @@ Feature: Directory directives
163
163
  end
164
164
  end
165
165
  """
166
- When I run `reek -c config.reek other/ web_app/`
166
+ When I run reek -c config.reek other/ web_app/
167
167
  Then it reports:
168
168
  """
169
169
  other/projects_controller.rb -- 2 warnings:
170
- [1]:InstanceVariableAssumption: ProjectController assumes too much for instance variable '@project' [https://github.com/troessner/reek/blob/master/docs/Instance-Variable-Assumption.md]
171
- [4]:NestedIterators: ProjectController#show contains iterators nested 2 deep [https://github.com/troessner/reek/blob/master/docs/Nested-Iterators.md]
170
+ [1]:InstanceVariableAssumption: ProjectController assumes too much for instance variable '@project'
171
+ [4]:NestedIterators: ProjectController#show contains iterators nested 2 deep
172
172
  web_app/app/controllers/users_controller.rb -- 2 warnings:
173
- [1]:InstanceVariableAssumption: UsersController assumes too much for instance variable '@user' [https://github.com/troessner/reek/blob/master/docs/Instance-Variable-Assumption.md]
174
- [1]:IrresponsibleModule: UsersController has no descriptive comment [https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md]
173
+ [1]:InstanceVariableAssumption: UsersController assumes too much for instance variable '@user'
174
+ [1]:IrresponsibleModule: UsersController has no descriptive comment
175
175
  4 total warnings
176
176
  """
177
177
 
@@ -190,7 +190,7 @@ Feature: Directory directives
190
190
  end
191
191
  """
192
192
 
193
- When I run `reek -c config.reek dummy_directory/`
193
+ When I run reek -c config.reek dummy_directory/
194
194
  Then the exit status indicates an error
195
195
  And stderr reports:
196
196
  """
@@ -213,7 +213,7 @@ Feature: Directory directives
213
213
  class Dummy
214
214
  end
215
215
  """
216
- When I run `reek -c config.reek dummy_directory/`
216
+ When I run reek -c config.reek dummy_directory/
217
217
  Then the exit status indicates an error
218
218
  And stderr reports:
219
219
  """
@@ -258,12 +258,12 @@ Feature: Directory directives
258
258
  end
259
259
  end
260
260
  """
261
- When I run `reek -c config.reek foo/`
261
+ When I run reek -c config.reek foo/
262
262
  Then it reports:
263
263
  """
264
264
  foo/bar/baz/klass.rb -- 1 warning:
265
- [4]:NestedIterators: Klass#meth contains iterators nested 2 deep [https://github.com/troessner/reek/blob/master/docs/Nested-Iterators.md]
265
+ [4]:NestedIterators: Klass#meth contains iterators nested 2 deep
266
266
  foo/bar/klazz.rb -- 1 warning:
267
- [1]:IrresponsibleModule: Klazz has no descriptive comment [https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md]
267
+ [1]:IrresponsibleModule: Klazz has no descriptive comment
268
268
  2 total warnings
269
269
  """
@@ -25,10 +25,10 @@ Feature: Exclude directives
25
25
  def foobar; end # Should not report UnusedPrivateMethod
26
26
  end
27
27
  """
28
- When I run `reek -c config.reek smelly.rb`
28
+ When I run reek -c config.reek smelly.rb
29
29
  Then it reports:
30
30
  """
31
31
  smelly.rb -- 2 warnings:
32
- [1]:IrresponsibleModule: Smelly has no descriptive comment [https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md]
33
- [3]:UnusedParameters: Smelly#foo has unused parameter 'arg' [https://github.com/troessner/reek/blob/master/docs/Unused-Parameters.md]
32
+ [1]:IrresponsibleModule: Smelly has no descriptive comment
33
+ [3]:UnusedParameters: Smelly#foo has unused parameter 'arg'
34
34
  """
@@ -11,7 +11,7 @@ Feature: Exclude paths directives
11
11
  def alfa(bravo); end
12
12
  end
13
13
  """
14
- When I run `reek .`
14
+ When I run reek .
15
15
  Then the exit status indicates smells
16
16
  Given a file named "config.reek" with:
17
17
  """
@@ -19,7 +19,7 @@ Feature: Exclude paths directives
19
19
  exclude_paths:
20
20
  - bad_files_live_here
21
21
  """
22
- When I run `reek -c config.reek .`
22
+ When I run reek -c config.reek .
23
23
  Then it succeeds
24
24
  And it reports nothing
25
25
  Scenario: Using a file name within an excluded directory
@@ -36,8 +36,8 @@ Feature: Exclude paths directives
36
36
  exclude_paths:
37
37
  - bad_files_live_here
38
38
  """
39
- When I run `reek -c config.reek bad_files_live_here/smelly.rb`
39
+ When I run reek -c config.reek bad_files_live_here/smelly.rb
40
40
  Then the exit status indicates smells
41
- When I run `reek -c config.reek --force-exclusion bad_files_live_here/smelly.rb`
41
+ When I run reek -c config.reek --force-exclusion bad_files_live_here/smelly.rb
42
42
  Then it succeeds
43
43
  And it reports nothing
@@ -30,7 +30,7 @@ Feature: Masking smells using config files
30
30
  And it reports:
31
31
  """
32
32
  smelly.rb -- 1 warning:
33
- [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
33
+ [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y'
34
34
  """
35
35
 
36
36
  Scenario: provide extra masking inline in comments
@@ -48,8 +48,8 @@ Feature: Masking smells using config files
48
48
  And it reports:
49
49
  """
50
50
  smelly.rb -- 2 warnings:
51
- [4]:UncommunicativeMethodName: Smelly#x has the name 'x' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
52
- [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md]
51
+ [4]:UncommunicativeMethodName: Smelly#x has the name 'x'
52
+ [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y'
53
53
  """
54
54
 
55
55
  Scenario: Disable UtilityFunction for non-public methods
@@ -60,6 +60,6 @@ Feature: Masking smells using config files
60
60
  And it reports:
61
61
  """
62
62
  smelly_with_modifiers.rb -- 1 warning:
63
- [7]:UtilityFunction: Klass#public_method doesn't depend on instance state (maybe move it to another class?) [https://github.com/troessner/reek/blob/master/docs/Utility-Function.md]
63
+ [7]:UtilityFunction: Klass#public_method doesn't depend on instance state (maybe move it to another class?)
64
64
  """
65
65
  But it does not report private or protected methods
@@ -22,12 +22,12 @@ Feature: Mix `accept` and `reject` configuration settings
22
22
  def foobar; end # Should be reported
23
23
  def awesome_helper; end # Should be reported
24
24
  """
25
- When I run `reek -c config.reek smelly.rb`
25
+ When I run reek -c config.reek smelly.rb
26
26
  Then it reports:
27
27
  """
28
28
  smelly.rb -- 2 warnings:
29
- [4]:UncommunicativeMethodName: awesome_helper has the name 'awesome_helper' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
30
- [3]:UncommunicativeMethodName: foobar has the name 'foobar' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
29
+ [4]:UncommunicativeMethodName: awesome_helper has the name 'awesome_helper'
30
+ [3]:UncommunicativeMethodName: foobar has the name 'foobar'
31
31
  """
32
32
 
33
33
  Scenario: UncommunicativeModuleName
@@ -49,11 +49,11 @@ Feature: Mix `accept` and `reject` configuration settings
49
49
  class M; end # Should not be reported
50
50
  class BaseHelper; end # Should be reported
51
51
  """
52
- When I run `reek -c config.reek smelly.rb`
52
+ When I run reek -c config.reek smelly.rb
53
53
  Then it reports:
54
54
  """
55
55
  smelly.rb -- 1 warning:
56
- [3]:UncommunicativeModuleName: BaseHelper has the name 'BaseHelper' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Module-Name.md]
56
+ [3]:UncommunicativeModuleName: BaseHelper has the name 'BaseHelper'
57
57
  """
58
58
 
59
59
  Scenario: UncommunicativeParameterName
@@ -73,9 +73,9 @@ Feature: Mix `accept` and `reject` configuration settings
73
73
  def omg(arg1); arg1; end # Should not be reported
74
74
  def omg(foobar); foobar; end # Should be reported
75
75
  """
76
- When I run `reek -c config.reek smelly.rb`
76
+ When I run reek -c config.reek smelly.rb
77
77
  Then it reports:
78
78
  """
79
79
  smelly.rb -- 1 warning:
80
- [3]:UncommunicativeParameterName: omg has the parameter name 'foobar' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Parameter-Name.md]
80
+ [3]:UncommunicativeParameterName: omg has the parameter name 'foobar'
81
81
  """
@@ -30,15 +30,15 @@ Feature: `reject` configuration setting
30
30
  def meth(argument); argument; end
31
31
  end
32
32
  """
33
- When I run `reek -c config.reek smelly.rb`
33
+ When I run reek -c config.reek smelly.rb
34
34
  Then it reports:
35
35
  """
36
36
  smelly.rb -- 5 warnings:
37
- [4]:UncommunicativeMethodName: Dummy#awesome_helper has the name 'awesome_helper' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
38
- [6]:UncommunicativeMethodName: Dummy#little_helper has the name 'little_helper' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
39
- [2]:UncommunicativeModuleName: Dummy has the name 'Dummy' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Module-Name.md]
40
- [4]:UncommunicativeParameterName: Dummy#awesome_helper has the parameter name 'solid_argument' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Parameter-Name.md]
41
- [6]:UncommunicativeParameterName: Dummy#little_helper has the parameter name 'nifty_argument' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Parameter-Name.md]
37
+ [4]:UncommunicativeMethodName: Dummy#awesome_helper has the name 'awesome_helper'
38
+ [6]:UncommunicativeMethodName: Dummy#little_helper has the name 'little_helper'
39
+ [2]:UncommunicativeModuleName: Dummy has the name 'Dummy'
40
+ [4]:UncommunicativeParameterName: Dummy#awesome_helper has the parameter name 'solid_argument'
41
+ [6]:UncommunicativeParameterName: Dummy#little_helper has the parameter name 'nifty_argument'
42
42
  """
43
43
 
44
44
  Scenario: reject regexes as list and as single item
@@ -66,13 +66,13 @@ Feature: `reject` configuration setting
66
66
  def meth(argument); argument; end
67
67
  end
68
68
  """
69
- When I run `reek -c config.reek smelly.rb`
69
+ When I run reek -c config.reek smelly.rb
70
70
  Then it reports:
71
71
  """
72
72
  smelly.rb -- 5 warnings:
73
- [4]:UncommunicativeMethodName: Dummy#awesome_helper has the name 'awesome_helper' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
74
- [6]:UncommunicativeMethodName: Dummy#little_helper has the name 'little_helper' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Method-Name.md]
75
- [2]:UncommunicativeModuleName: Dummy has the name 'Dummy' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Module-Name.md]
76
- [4]:UncommunicativeParameterName: Dummy#awesome_helper has the parameter name 'solid_argument' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Parameter-Name.md]
77
- [6]:UncommunicativeParameterName: Dummy#little_helper has the parameter name 'nifty_argument' [https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Parameter-Name.md]
73
+ [4]:UncommunicativeMethodName: Dummy#awesome_helper has the name 'awesome_helper'
74
+ [6]:UncommunicativeMethodName: Dummy#little_helper has the name 'little_helper'
75
+ [2]:UncommunicativeModuleName: Dummy has the name 'Dummy'
76
+ [4]:UncommunicativeParameterName: Dummy#awesome_helper has the parameter name 'solid_argument'
77
+ [6]:UncommunicativeParameterName: Dummy#little_helper has the parameter name 'nifty_argument'
78
78
  """