Merge pull request #617 from mbj/fix/new-critic-offenses

Fix RuboCop and Reek violations
This commit is contained in:
Markus Schirp 2016-07-24 21:09:26 +00:00 committed by GitHub
commit d07daec9d8
9 changed files with 15 additions and 21 deletions

View file

@ -1,6 +1,8 @@
module Mutant module Mutant
module AST module AST
# Singleton nodes # Singleton nodes
#
# :reek:TooManyConstants
module Nodes module Nodes
extend Sexp extend Sexp

View file

@ -1,6 +1,8 @@
module Mutant module Mutant
module AST module AST
# Groups of node types # Groups of node types
#
# :reek:TooManyConstants
module Types module Types
symbolset = ->(strings) { strings.map(&:to_sym).to_set.freeze } symbolset = ->(strings) { strings.map(&:to_sym).to_set.freeze }

View file

@ -17,6 +17,8 @@ module Mutant
# * location # * location
# Is NOT enough. It would not be unique. So we add an "example index" # Is NOT enough. It would not be unique. So we add an "example index"
# for unique reference. # for unique reference.
#
# :reek:TooManyConstants
class Rspec < self class Rspec < self
ALL_EXPRESSION = Expression::Namespace::Recursive.new(scope_name: nil) ALL_EXPRESSION = Expression::Namespace::Recursive.new(scope_name: nil)

View file

@ -1,6 +1,8 @@
module Mutant module Mutant
class Matcher class Matcher
# Subject matcher configuration # Subject matcher configuration
#
# :reek:TooManyConstants
class Config class Config
include Adamantium, Anima.new( include Adamantium, Anima.new(
:ignore_expressions, :ignore_expressions,

View file

@ -54,8 +54,6 @@ module Mutant
# @param [Fixnum] index # @param [Fixnum] index
# #
# @return [undefined] # @return [undefined]
#
# rubocop:disable RedundantBlockCall - its not redundant here
def mutate_child(index, &block) def mutate_child(index, &block)
block ||= TAUTOLOGY block ||= TAUTOLOGY
Mutator.mutate(children.fetch(index), self).each do |mutation| Mutator.mutate(children.fetch(index), self).each do |mutation|

View file

@ -3,6 +3,8 @@ module Mutant
class CLI class CLI
class Printer class Printer
# Reporter for mutation results # Reporter for mutation results
#
# :reek:TooManyConstants
class MutationResult < self class MutationResult < self
delegate :mutation, :test_result delegate :mutation, :test_result

View file

@ -294,7 +294,6 @@ module MutantSpec
end end
end # ErrorWhitelist end # ErrorWhitelist
# rubocop:disable ClosingParenthesisIndentation
LOADER = Morpher.build do LOADER = Morpher.build do
s(:block, s(:block,
s(:guard, s(:primitive, Array)), s(:guard, s(:primitive, Array)),
@ -317,22 +316,14 @@ module MutantSpec
[ [
->(hash) { hash.map { |key, values| [key, values.map(&Pathname.method(:new))] }.to_h }, ->(hash) { hash.map { |key, values| [key, values.map(&Pathname.method(:new))] }.to_h },
->(hash) { hash.map { |key, values| [key, values.map(&:to_s)] }.to_h } ->(hash) { hash.map { |key, values| [key, values.map(&:to_s)] }.to_h }
] ]),
), s(:load_attribute_hash, s(:param, ErrorWhitelist))))),
s(:load_attribute_hash, s(:param, ErrorWhitelist))
)
)
),
s(:load_attribute_hash, s(:load_attribute_hash,
# NOTE: The domain param has no DSL currently! # NOTE: The domain param has no DSL currently!
Morpher::Evaluator::Transformer::Domain::Param.new( Morpher::Evaluator::Transformer::Domain::Param.new(
Project, Project,
%i[repo_uri name expected_errors mutation_coverage mutation_generation] %i[repo_uri name expected_errors mutation_coverage mutation_generation]
) )))))
)
)
)
)
end end
ALL = LOADER.call(YAML.load_file(ROOT.join('spec', 'integrations.yml'))) ALL = LOADER.call(YAML.load_file(ROOT.join('spec', 'integrations.yml')))

View file

@ -1,4 +1,3 @@
# rubocop:disable ClosingParenthesisIndentation
RSpec.describe Mutant::Context do RSpec.describe Mutant::Context do
describe '.wrap' do describe '.wrap' do
subject { described_class.wrap(scope, node) } subject { described_class.wrap(scope, node) }
@ -11,8 +10,7 @@ RSpec.describe Mutant::Context do
let(:expected) do let(:expected) do
s(:module, s(:module,
s(:const, nil, :Mutant), s(:const, nil, :Mutant),
s(:str, 'test') s(:str, 'test'))
)
end end
it { should eql(expected) } it { should eql(expected) }
@ -25,8 +23,7 @@ RSpec.describe Mutant::Context do
s(:class, s(:class,
s(:const, nil, :Context), s(:const, nil, :Context),
nil, nil,
s(:str, 'test') s(:str, 'test'))
)
end end
it { should eql(expected) } it { should eql(expected) }

View file

@ -16,8 +16,6 @@ RSpec.describe Mutant::Matcher::Methods::Instance, '#call' do
private :method_d private :method_d
public
def method_a def method_a
end end