reek 3.6.1 → 3.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/features/command_line_interface/basic_usage.feature +8 -8
  4. data/features/command_line_interface/options.feature +2 -1
  5. data/features/command_line_interface/smell_selection.feature +1 -1
  6. data/features/command_line_interface/smells_count.feature +8 -8
  7. data/features/command_line_interface/stdin.feature +3 -3
  8. data/features/configuration_files/directory_specific_directives.feature +9 -9
  9. data/features/configuration_files/masking_smells.feature +5 -5
  10. data/features/configuration_loading.feature +6 -6
  11. data/features/programmatic_access.feature +3 -3
  12. data/features/rake_task/rake_task.feature +9 -9
  13. data/features/reports/json.feature +4 -0
  14. data/features/reports/reports.feature +49 -37
  15. data/features/reports/yaml.feature +4 -0
  16. data/features/samples.feature +265 -265
  17. data/lib/reek/cli/options.rb +5 -4
  18. data/lib/reek/cli/warning_collector.rb +1 -1
  19. data/lib/reek/report.rb +2 -1
  20. data/lib/reek/report/code_climate_formatter.rb +46 -0
  21. data/lib/reek/report/formatter.rb +13 -8
  22. data/lib/reek/report/report.rb +12 -0
  23. data/lib/reek/smells/smell_warning.rb +2 -2
  24. data/lib/reek/version.rb +1 -1
  25. data/reek.gemspec +5 -4
  26. data/spec/reek/report/code_climate_formatter_spec.rb +63 -0
  27. data/spec/reek/report/code_climate_report_spec.rb +68 -0
  28. data/spec/reek/report/json_report_spec.rb +18 -18
  29. data/spec/reek/report/yaml_report_spec.rb +17 -17
  30. data/spec/reek/smells/smell_warning_spec.rb +11 -11
  31. data/spec/samples/checkstyle.xml +1 -1
  32. metadata +20 -3
@@ -52,12 +52,12 @@ RSpec.describe Reek::Smells::SmellWarning do
52
52
  it_should_behave_like 'first sorts ahead of second'
53
53
  end
54
54
 
55
- context 'message takes precedence over smell name' do
55
+ context 'smell name takes precedence over message' do
56
56
  let(:first) do
57
- build(:smell_warning, smell_detector: utility_function_detector, message: 'first message')
57
+ build(:smell_warning, smell_detector: feature_envy_detector, message: 'second message')
58
58
  end
59
59
  let(:second) do
60
- build(:smell_warning, smell_detector: feature_envy_detector, message: 'second message')
60
+ build(:smell_warning, smell_detector: utility_function_detector, message: 'first message')
61
61
  end
62
62
 
63
63
  it_should_behave_like 'first sorts ahead of second'
@@ -65,14 +65,6 @@ RSpec.describe Reek::Smells::SmellWarning do
65
65
 
66
66
  context 'smells differing everywhere' do
67
67
  let(:first) do
68
- uncommunicative_name_detector = build(:smell_detector,
69
- smell_type: 'UncommunicativeVariableName')
70
- build(:smell_warning, smell_detector: uncommunicative_name_detector,
71
- context: 'Dirty',
72
- message: "has the variable name '@s'")
73
- end
74
-
75
- let(:second) do
76
68
  duplication_detector = build(:smell_detector,
77
69
  smell_type: 'DuplicateMethodCall')
78
70
  build(:smell_warning, smell_detector: duplication_detector,
@@ -80,6 +72,14 @@ RSpec.describe Reek::Smells::SmellWarning do
80
72
  message: 'calls @s.title twice')
81
73
  end
82
74
 
75
+ let(:second) do
76
+ uncommunicative_name_detector = build(:smell_detector,
77
+ smell_type: 'UncommunicativeVariableName')
78
+ build(:smell_warning, smell_detector: uncommunicative_name_detector,
79
+ context: 'Dirty',
80
+ message: "has the variable name '@s'")
81
+ end
82
+
83
83
  it_should_behave_like 'first sorts ahead of second'
84
84
  end
85
85
  end
@@ -1,13 +1,13 @@
1
1
  <?xml version='1.0'?>
2
2
  <checkstyle>
3
3
  <file name='spec/samples/two_smelly_files/dirty_one.rb'>
4
- <error column='0' line='5' message='has the variable name &apos;@s&apos;' severity='warning' source='UncommunicativeVariableName'/>
5
4
  <error column='0' line='4' message='calls @s.title 2 times' severity='warning' source='DuplicateMethodCall'/>
6
5
  <error column='0' line='6' message='calls @s.title 2 times' severity='warning' source='DuplicateMethodCall'/>
7
6
  <error column='0' line='4' message='calls puts(@s.title) 2 times' severity='warning' source='DuplicateMethodCall'/>
8
7
  <error column='0' line='6' message='calls puts(@s.title) 2 times' severity='warning' source='DuplicateMethodCall'/>
9
8
  <error column='0' line='5' message='contains iterators nested 2 deep' severity='warning' source='NestedIterators'/>
10
9
  <error column='0' line='3' message='has the name &apos;a&apos;' severity='warning' source='UncommunicativeMethodName'/>
10
+ <error column='0' line='5' message='has the variable name &apos;@s&apos;' severity='warning' source='UncommunicativeVariableName'/>
11
11
  <error column='0' line='5' message='has the variable name &apos;x&apos;' severity='warning' source='UncommunicativeVariableName'/>
12
12
  </file>
13
13
  </checkstyle>
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.6.1
4
+ version: 3.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Rutherford
@@ -11,8 +11,22 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-11-13 00:00:00.000000000 Z
14
+ date: 2015-11-18 00:00:00.000000000 Z
15
15
  dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: codeclimate-engine-rb
18
+ requirement: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: 0.1.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: 0.1.0
16
30
  - !ruby/object:Gem::Dependency
17
31
  name: parser
18
32
  requirement: !ruby/object:Gem::Requirement
@@ -336,6 +350,7 @@ files:
336
350
  - lib/reek/examiner.rb
337
351
  - lib/reek/rake/task.rb
338
352
  - lib/reek/report.rb
353
+ - lib/reek/report/code_climate_formatter.rb
339
354
  - lib/reek/report/formatter.rb
340
355
  - lib/reek/report/heading_formatter.rb
341
356
  - lib/reek/report/html_report.html.erb
@@ -409,6 +424,8 @@ files:
409
424
  - spec/reek/context/root_context_spec.rb
410
425
  - spec/reek/context/singleton_method_context_spec.rb
411
426
  - spec/reek/examiner_spec.rb
427
+ - spec/reek/report/code_climate_formatter_spec.rb
428
+ - spec/reek/report/code_climate_report_spec.rb
412
429
  - spec/reek/report/html_report_spec.rb
413
430
  - spec/reek/report/json_report_spec.rb
414
431
  - spec/reek/report/location_formatter_spec.rb
@@ -513,7 +530,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
513
530
  version: '0'
514
531
  requirements: []
515
532
  rubyforge_project:
516
- rubygems_version: 2.4.5.1
533
+ rubygems_version: 2.5.0
517
534
  signing_key:
518
535
  specification_version: 4
519
536
  summary: Code smell detector for Ruby