reek 3.4.0 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/features/step_definitions/reek_steps.rb +19 -16
  4. data/lib/reek/ast/sexp_extensions.rb +17 -8
  5. data/lib/reek/cli/application.rb +21 -12
  6. data/lib/reek/cli/option_interpreter.rb +1 -6
  7. data/lib/reek/cli/options.rb +32 -22
  8. data/lib/reek/report/location_formatter.rb +11 -5
  9. data/lib/reek/smells/smell_warning.rb +10 -2
  10. data/lib/reek/smells/uncommunicative_method_name.rb +25 -21
  11. data/lib/reek/smells/uncommunicative_parameter_name.rb +14 -15
  12. data/lib/reek/spec/should_reek_of.rb +44 -9
  13. data/lib/reek/version.rb +1 -1
  14. data/reek.gemspec +2 -2
  15. data/spec/reek/ast/node_spec.rb +1 -1
  16. data/spec/reek/ast/object_refs_spec.rb +1 -1
  17. data/spec/reek/ast/reference_collector_spec.rb +1 -1
  18. data/spec/reek/ast/sexp_extensions_spec.rb +49 -2
  19. data/spec/reek/ast/sexp_formatter_spec.rb +1 -1
  20. data/spec/reek/cli/option_interpreter_spec.rb +7 -7
  21. data/spec/reek/cli/options_spec.rb +27 -19
  22. data/spec/reek/cli/warning_collector_spec.rb +2 -2
  23. data/spec/reek/code_comment_spec.rb +1 -1
  24. data/spec/reek/configuration/app_configuration_spec.rb +4 -4
  25. data/spec/reek/configuration/default_directive_spec.rb +1 -1
  26. data/spec/reek/configuration/directory_directives_spec.rb +1 -1
  27. data/spec/reek/configuration/excluded_paths_spec.rb +1 -1
  28. data/spec/reek/context/code_context_spec.rb +2 -2
  29. data/spec/reek/context/method_context_spec.rb +1 -1
  30. data/spec/reek/context/module_context_spec.rb +2 -2
  31. data/spec/reek/context/root_context_spec.rb +1 -1
  32. data/spec/reek/context/singleton_method_context_spec.rb +1 -1
  33. data/spec/reek/examiner_spec.rb +1 -1
  34. data/spec/reek/report/html_report_spec.rb +2 -2
  35. data/spec/reek/report/json_report_spec.rb +3 -3
  36. data/spec/reek/report/location_formatter_spec.rb +30 -0
  37. data/spec/reek/report/text_report_spec.rb +4 -4
  38. data/spec/reek/report/xml_report_spec.rb +2 -2
  39. data/spec/reek/report/yaml_report_spec.rb +3 -3
  40. data/spec/reek/smells/attribute_spec.rb +1 -1
  41. data/spec/reek/smells/boolean_parameter_spec.rb +1 -1
  42. data/spec/reek/smells/class_variable_spec.rb +2 -2
  43. data/spec/reek/smells/control_parameter_spec.rb +1 -1
  44. data/spec/reek/smells/data_clump_spec.rb +1 -1
  45. data/spec/reek/smells/duplicate_method_call_spec.rb +3 -3
  46. data/spec/reek/smells/feature_envy_spec.rb +2 -2
  47. data/spec/reek/smells/irresponsible_module_spec.rb +2 -2
  48. data/spec/reek/smells/long_parameter_list_spec.rb +2 -2
  49. data/spec/reek/smells/long_yield_list_spec.rb +2 -2
  50. data/spec/reek/smells/module_initialize_spec.rb +1 -1
  51. data/spec/reek/smells/nested_iterators_spec.rb +1 -1
  52. data/spec/reek/smells/nil_check_spec.rb +2 -2
  53. data/spec/reek/smells/prima_donna_method_spec.rb +1 -1
  54. data/spec/reek/smells/repeated_conditional_spec.rb +3 -3
  55. data/spec/reek/smells/smell_configuration_spec.rb +1 -1
  56. data/spec/reek/smells/smell_repository_spec.rb +2 -2
  57. data/spec/reek/smells/smell_warning_spec.rb +1 -1
  58. data/spec/reek/smells/too_many_instance_variables_spec.rb +1 -1
  59. data/spec/reek/smells/too_many_methods_spec.rb +1 -1
  60. data/spec/reek/smells/too_many_statements_spec.rb +1 -1
  61. data/spec/reek/smells/uncommunicative_method_name_spec.rb +2 -2
  62. data/spec/reek/smells/uncommunicative_module_name_spec.rb +2 -2
  63. data/spec/reek/smells/uncommunicative_parameter_name_spec.rb +2 -2
  64. data/spec/reek/smells/uncommunicative_variable_name_spec.rb +1 -1
  65. data/spec/reek/smells/unused_parameters_spec.rb +1 -1
  66. data/spec/reek/smells/utility_function_spec.rb +2 -2
  67. data/spec/reek/source/source_code_spec.rb +1 -1
  68. data/spec/reek/source/source_locator_spec.rb +2 -2
  69. data/spec/reek/spec/should_reek_of_spec.rb +90 -37
  70. data/spec/reek/spec/should_reek_only_of_spec.rb +1 -1
  71. data/spec/reek/spec/should_reek_spec.rb +1 -1
  72. data/spec/reek/tree_dresser_spec.rb +2 -2
  73. data/spec/reek/tree_walker_spec.rb +2 -2
  74. data/spec/spec_helper.rb +6 -0
  75. metadata +7 -6
@@ -1,5 +1,5 @@
1
1
  require_relative '../../spec_helper'
2
- require_relative '../../../lib/reek/spec'
2
+ require_lib 'reek/spec'
3
3
 
4
4
  RSpec.describe Reek::Spec::ShouldReekOnlyOf do
5
5
  let(:examiner) { double('examiner').as_null_object }
@@ -1,5 +1,5 @@
1
1
  require_relative '../../spec_helper'
2
- require_relative '../../../lib/reek/spec'
2
+ require_lib 'reek/spec'
3
3
 
4
4
  RSpec.describe Reek::Spec::ShouldReek do
5
5
  describe 'checking code in a string' do
@@ -1,10 +1,10 @@
1
- require_relative '../../lib/reek/cli/silencer'
1
+ require_lib 'reek/cli/silencer'
2
2
  Reek::CLI::Silencer.silently do
3
3
  require 'parser/ruby22'
4
4
  end
5
5
 
6
6
  require_relative '../spec_helper'
7
- require_relative '../../lib/reek/tree_dresser'
7
+ require_lib 'reek/tree_dresser'
8
8
 
9
9
  RSpec.describe Reek::TreeDresser do
10
10
  let(:dresser) { described_class.new }
@@ -1,6 +1,6 @@
1
1
  require_relative '../spec_helper'
2
- require_relative '../../lib/reek/tree_walker'
3
- require_relative '../../lib/reek/source/source_code'
2
+ require_lib 'reek/tree_walker'
3
+ require_lib 'reek/source/source_code'
4
4
 
5
5
  # Dummy repository to inject into TreeWalker in order to count statements in
6
6
  # all contexts.
@@ -52,3 +52,9 @@ RSpec.configure do |config|
52
52
  mocks.verify_partial_doubles = true
53
53
  end
54
54
  end
55
+
56
+ private
57
+
58
+ def require_lib(path)
59
+ require_relative "../lib/#{path}"
60
+ end
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: 3.4.0
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Rutherford
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-09-16 00:00:00.000000000 Z
14
+ date: 2015-09-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: parser
@@ -89,14 +89,14 @@ dependencies:
89
89
  requirements:
90
90
  - - "~>"
91
91
  - !ruby/object:Gem::Version
92
- version: 0.8.0
92
+ version: 0.9.0
93
93
  type: :development
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - "~>"
98
98
  - !ruby/object:Gem::Version
99
- version: 0.8.0
99
+ version: 0.9.0
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: ataru
102
102
  requirement: !ruby/object:Gem::Requirement
@@ -187,14 +187,14 @@ dependencies:
187
187
  requirements:
188
188
  - - "~>"
189
189
  - !ruby/object:Gem::Version
190
- version: 0.33.0
190
+ version: 0.34.0
191
191
  type: :development
192
192
  prerelease: false
193
193
  version_requirements: !ruby/object:Gem::Requirement
194
194
  requirements:
195
195
  - - "~>"
196
196
  - !ruby/object:Gem::Version
197
- version: 0.33.0
197
+ version: 0.34.0
198
198
  description: |2
199
199
  Reek is a tool that examines Ruby classes, modules and methods and reports
200
200
  any code smells it finds.
@@ -380,6 +380,7 @@ files:
380
380
  - spec/reek/examiner_spec.rb
381
381
  - spec/reek/report/html_report_spec.rb
382
382
  - spec/reek/report/json_report_spec.rb
383
+ - spec/reek/report/location_formatter_spec.rb
383
384
  - spec/reek/report/text_report_spec.rb
384
385
  - spec/reek/report/xml_report_spec.rb
385
386
  - spec/reek/report/yaml_report_spec.rb