reek 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2bd3b362caed94f8eec563376a0542677d215b9c
4
- data.tar.gz: 85af0be0c7132c4718b145b114d2013a836a8880
3
+ metadata.gz: 8c45202c174ceb4196695ec6f2a5b6a823c14d06
4
+ data.tar.gz: 34ec72fa7a3dc9cb07d40258e178ee8ab066e3b8
5
5
  SHA512:
6
- metadata.gz: e933370d907c7d45079a56e513c88363b3b6faeb8244651e6ac4a6f3e08242087e705490c8a5d86eee80fb585f5f74a3af7f5d2d49e42e672081b0e9d861f32c
7
- data.tar.gz: c0bcc02e84cd9475db5f2c59c1d74c9fc42e983ff79e373f951092224df4df8784fd00b2ce8d43a306d4ebe42e742dba2507e42893aa88a4798a47dc7874d726
6
+ metadata.gz: b2b8bf4eee7cba82e33ce1f2dbc6768c786829599d64d175d3eb232d82b3d9e6c605111ae0723e9164697ae9718194a4f91078cc4a6e130341b4bac1f178ed60
7
+ data.tar.gz: 52242fe4f536bb3d2bb2de1777b4cd77232307047392ad308542d0f1f62d4ecf337a8e7f78f892e6de95459accbbf17e7a1a1732fbce3bce924f82bb80e4d81f
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ * (chastell) Add keyword arguments support after switching to 'parser'
2
+ * (mvz) Handle nil-block in iterators
3
+
1
4
  == 1.5.0
2
5
 
3
6
  * (mvz) Parse with the parse gem
@@ -290,3 +290,13 @@ Feature: Basic smell detection
290
290
  spec/samples/ruby20_syntax.rb -- 1 warning:
291
291
  [1]:SomeClass has no descriptive comment (IrresponsibleModule)
292
292
  """
293
+
294
+ @ruby21
295
+ Scenario: Correct smells from a source file with Ruby 2.1 specific syntax
296
+ When I run reek spec/samples/ruby21_syntax.rb
297
+ Then the exit status indicates smells
298
+ And it reports:
299
+ """
300
+ spec/samples/ruby21_syntax.rb -- 1 warning:
301
+ [1]:SomeClass has no descriptive comment (IrresponsibleModule)
302
+ """
@@ -62,6 +62,7 @@ module Reek
62
62
  end
63
63
 
64
64
  def find_iters(exp, depth)
65
+ return [] unless exp
65
66
  exp.find_nodes([:block]).flat_map do |elem|
66
67
  find_iters_for_iter_node(elem, depth)
67
68
  end
@@ -40,6 +40,11 @@ module Reek
40
40
  include ArgNodeBase
41
41
  end
42
42
 
43
+ # Utility methods for :kwarg nodes.
44
+ module KwargNode
45
+ include ArgNodeBase
46
+ end
47
+
43
48
  # Utility methods for :optarg nodes.
44
49
  module OptargNode
45
50
  include ArgNodeBase
@@ -1,3 +1,3 @@
1
1
  module Reek
2
- VERSION = '1.5.0'
2
+ VERSION = '1.5.1'
3
3
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
  s.require_paths = ['lib']
28
28
  s.rubyforge_project = 'reek'
29
29
  s.rubygems_version = '1.3.6'
30
- s.required_ruby_version = '>= 1.9.2'
30
+ s.required_ruby_version = '>= 1.9.3'
31
31
  s.summary = 'Code smell detector for Ruby'
32
32
 
33
33
  s.add_runtime_dependency('parser', ['~> 2.2.0.pre.7'])
@@ -44,6 +44,15 @@ EOS
44
44
  expect(src).not_to smell_of(NestedIterators)
45
45
  end
46
46
 
47
+ it 'detects an iterator with an empty block' do
48
+ src = <<-EOS
49
+ def foo
50
+ bar { baz { } }
51
+ end
52
+ EOS
53
+ expect(src).to smell_of(NestedIterators, {})
54
+ end
55
+
47
56
  it 'should report nested iterators only once per method' do
48
57
  src = <<EOS
49
58
  def bad(fred)
@@ -0,0 +1,5 @@
1
+ class SomeClass
2
+ def method_with_required_keyword_arguments(foo:)
3
+ puts foo
4
+ end
5
+ 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: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Rutherford
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-12-01 00:00:00.000000000 Z
13
+ date: 2014-12-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parser
@@ -341,6 +341,7 @@ files:
341
341
  - spec/samples/overrides_defaults/config.reek
342
342
  - spec/samples/redcloth.rb
343
343
  - spec/samples/ruby20_syntax.rb
344
+ - spec/samples/ruby21_syntax.rb
344
345
  - spec/samples/three_clean_files/clean_one.rb
345
346
  - spec/samples/three_clean_files/clean_three.rb
346
347
  - spec/samples/three_clean_files/clean_two.rb
@@ -369,7 +370,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
369
370
  requirements:
370
371
  - - ">="
371
372
  - !ruby/object:Gem::Version
372
- version: 1.9.2
373
+ version: 1.9.3
373
374
  required_rubygems_version: !ruby/object:Gem::Requirement
374
375
  requirements:
375
376
  - - ">="