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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/reek/ast/sexp_extensions.rb +1 -0
- data/lib/reek/ast/sexp_extensions/lambda.rb +13 -0
- data/lib/reek/version.rb +1 -1
- data/spec/reek/ast/sexp_extensions_spec.rb +10 -0
- data/spec/reek/smells/nested_iterators_spec.rb +20 -0
- data/tasks/mutant.rake +15 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed3e33db32a0d7b3de163a1ac8d9f042d0123e00
|
4
|
+
data.tar.gz: 6316cc39b5ed860bbca0b4f47aca9f3547709eca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f81127feca9c714604fdb3e80cdb1a83e071359e953f902de08295b14ebf6942f345613b1f6b9b90e259364aa194a1704038c8a8e1f03c4beabab51b7e0319e
|
7
|
+
data.tar.gz: bbbbe01a9d539dd9b50a1c883fdbbe519d2258abedaaa16e59cb481a7576048be7743163f8bad3cabc867a9b4fb8353e07220e29b6cbae7f82f6cdf403fe3722
|
data/CHANGELOG.md
CHANGED
@@ -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'
|
data/lib/reek/version.rb
CHANGED
@@ -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 }
|
data/tasks/mutant.rake
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
desc 'Runs mutant'
|
2
2
|
task :mutant do
|
3
|
-
|
4
|
-
|
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
|
+
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-
|
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
|