reek 4.0.4 → 4.0.5

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: 7c09dc83cbd7c49a57a5e0568479ccf87a8c284d
4
- data.tar.gz: 7a9643ce33812488821abaabaf157eee3ba1f886
3
+ metadata.gz: ed3e33db32a0d7b3de163a1ac8d9f042d0123e00
4
+ data.tar.gz: 6316cc39b5ed860bbca0b4f47aca9f3547709eca
5
5
  SHA512:
6
- metadata.gz: e85233445ea0535f360876d6f45398ff364aa895883b0175a60097839fbb5182b399496010c675253a9b79efdd15b1ca759db9253ea7febfc916efe2a3e3013f
7
- data.tar.gz: cdc14223fc488191e56d3642c1bff7affeb9f4e97fc9f6030d1bd7988f7c75f133ad824724da58785c44556ab0a2483f7893f35c219eb666f22dfcb21f8b6082
6
+ metadata.gz: 5f81127feca9c714604fdb3e80cdb1a83e071359e953f902de08295b14ebf6942f345613b1f6b9b90e259364aa194a1704038c8a8e1f03c4beabab51b7e0319e
7
+ data.tar.gz: bbbbe01a9d539dd9b50a1c883fdbbe519d2258abedaaa16e59cb481a7576048be7743163f8bad3cabc867a9b4fb8353e07220e29b6cbae7f82f6cdf403fe3722
@@ -1,5 +1,9 @@
1
1
  # Change log
2
2
 
3
+ ## 4.0.5 (2016-06-16)
4
+
5
+ * (mvz) Handle new lambda syntax in NestedIterators
6
+
3
7
  ## 4.0.4 (2016-06-11)
4
8
 
5
9
  * (troessner) Bump parser
@@ -7,6 +7,7 @@ require_relative 'sexp_extensions/block'
7
7
  require_relative 'sexp_extensions/case'
8
8
  require_relative 'sexp_extensions/constant'
9
9
  require_relative 'sexp_extensions/if'
10
+ require_relative 'sexp_extensions/lambda'
10
11
  require_relative 'sexp_extensions/literal'
11
12
  require_relative 'sexp_extensions/logical_operators'
12
13
  require_relative 'sexp_extensions/methods'
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+ module Reek
3
+ module AST
4
+ module SexpExtensions
5
+ # Utility methods for :lambda nodes.
6
+ module LambdaNode
7
+ def name
8
+ 'lambda'
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -7,6 +7,6 @@ module Reek
7
7
  # @public
8
8
  module Version
9
9
  # @public
10
- STRING = '4.0.4'.freeze
10
+ STRING = '4.0.5'.freeze
11
11
  end
12
12
  end
@@ -332,6 +332,16 @@ RSpec.describe Reek::AST::SexpExtensions::BlockNode do
332
332
  end
333
333
  end
334
334
 
335
+ RSpec.describe Reek::AST::SexpExtensions::LambdaNode do
336
+ let(:node) { sexp(:lambda) }
337
+
338
+ context '#name' do
339
+ it 'returns :lambda' do
340
+ expect(node.name).to eq 'lambda'
341
+ end
342
+ end
343
+ end
344
+
335
345
  RSpec.describe Reek::AST::SexpExtensions::ModuleNode do
336
346
  context 'with a simple name' do
337
347
  subject do
@@ -173,6 +173,26 @@ RSpec.describe Reek::Smells::NestedIterators do
173
173
  end
174
174
  end
175
175
 
176
+ context 'when blocks are specified as lambdas' do
177
+ it 'does not report blocks that are not nested' do
178
+ source = <<-EOS
179
+ def foo
180
+ bar ->(x) { baz x }
181
+ end
182
+ EOS
183
+ expect(source).not_to reek_of(:NestedIterators)
184
+ end
185
+
186
+ it 'reports blocks that are nested' do
187
+ source = <<-EOS
188
+ def foo
189
+ bar ->(x) { baz x, ->(y) { quux y } }
190
+ end
191
+ EOS
192
+ expect(source).to reek_of(:NestedIterators)
193
+ end
194
+ end
195
+
176
196
  context 'when the allowed nesting depth is 3' do
177
197
  let(:config) do
178
198
  { Reek::Smells::NestedIterators::MAX_ALLOWED_NESTING_KEY => 3 }
@@ -1,5 +1,18 @@
1
1
  desc 'Runs mutant'
2
2
  task :mutant do
3
- system 'RUBY_THREAD_VM_STACK_SIZE=64000 bundle exec mutant --include lib '\
4
- "--require reek --use rspec --since master --jobs 4 'Reek*'"
3
+ command = <<-EOS
4
+ branch_name=$(git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3)
5
+ if [ "$branch_name" != "master" ]; then
6
+ RUBY_THREAD_VM_STACK_SIZE=64000\
7
+ bundle exec mutant\
8
+ --include lib\
9
+ --require reek\
10
+ --use rspec\
11
+ --since master\
12
+ --jobs 4 'Reek*'
13
+ else
14
+ echo "!!! Not running mutant on master branch !!!"
15
+ fi
16
+ EOS
17
+ system command
5
18
  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: 4.0.4
4
+ version: 4.0.5
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: 2016-06-12 00:00:00.000000000 Z
14
+ date: 2016-06-16 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: codeclimate-engine-rb
@@ -173,6 +173,7 @@ files:
173
173
  - lib/reek/ast/sexp_extensions/case.rb
174
174
  - lib/reek/ast/sexp_extensions/constant.rb
175
175
  - lib/reek/ast/sexp_extensions/if.rb
176
+ - lib/reek/ast/sexp_extensions/lambda.rb
176
177
  - lib/reek/ast/sexp_extensions/literal.rb
177
178
  - lib/reek/ast/sexp_extensions/logical_operators.rb
178
179
  - lib/reek/ast/sexp_extensions/methods.rb