Fix rubocop violations

This commit is contained in:
Markus Schirp 2016-12-03 14:30:04 +00:00
parent 7c3f3a5f5c
commit 6c4e1a848d
13 changed files with 29 additions and 39 deletions

View file

@ -1,7 +1,7 @@
AllCops:
DisplayCopNames: true
Exclude:
- 'vendor/**/*'
- 'tmp/**/*'
- 'test_app/**/*'
- 'bin/mutant'
- 'tmp/**/*'
- 'vendor/**/*'
TargetRubyVersion: 2.2

View file

@ -21,7 +21,7 @@ namespace =
.curry
.call(Kernel),
root_require: 'mutant',
includes: %w[
includes: %w[
mutant
unparser
morpher

View file

@ -177,3 +177,6 @@ AlignHash:
# Prefer `public_send` and `__send__` over `send`
Send:
Enabled: true
Lint/UnifiedInteger:
Enabled: false

View file

@ -29,8 +29,7 @@ module Mutant
# Initialize null color
#
# @return [undefined]
def initialize
end
def initialize; end
end.new

View file

@ -12,8 +12,7 @@ module Mutant
# Emit mutations
#
# @return [undefined]
def dispatch
end
def dispatch; end
end # Nil
end # Literal

View file

@ -29,6 +29,7 @@ Mutant::Meta::Example.add :case do
RUBY
end
# rubocop:disable Metrics/BlockLength
Mutant::Meta::Example.add :case do
source <<-RUBY
case condition

View file

@ -1,5 +1,6 @@
require File.expand_path('../lib/mutant/version', __FILE__)
# rubocop:disable Metrics/BlockLength
Gem::Specification.new do |gem|
gem.name = 'mutant'
gem.version = Mutant::VERSION.dup

View file

@ -77,9 +77,9 @@ module XSpec
private_class_method :assert_not_empty
def self.assert_total(event_list)
if event_list[0..-2].map(&:first).any?(&TERMINATE_EVENTS.method(:include?))
fail "Reaction not total: #{event_list}"
end
return unless event_list[0..-2].map(&:first).any?(&TERMINATE_EVENTS.method(:include?))
fail "Reaction not total: #{event_list}"
end
private_class_method :assert_total
end # MessageReaction

View file

@ -93,8 +93,7 @@ RSpec.describe Mutant::Env::Bootstrap do
# Fix Class#name so other specs do not see this one
class << invalid_class
undef :name
def name
end
def name; end
end
end
@ -151,8 +150,7 @@ RSpec.describe Mutant::Env::Bootstrap do
# Fix Class#name so other specs do not see this one
class << invalid_class
undef :name
def name
end
def name; end
end
end

View file

@ -4,11 +4,9 @@ RSpec.describe Mutant::Matcher::Methods::Instance, '#call' do
let(:class_under_test) do
parent = Module.new do
def method_d
end
def method_d; end
def method_e
end
def method_e; end
end
Class.new do
@ -16,18 +14,15 @@ RSpec.describe Mutant::Matcher::Methods::Instance, '#call' do
private :method_d
def method_a
end
def method_a; end
protected
def method_b
end
def method_b; end
private
def method_c
end
def method_c; end
end
end

View file

@ -4,25 +4,20 @@ RSpec.describe Mutant::Matcher::Methods::Singleton, '#call' do
let(:class_under_test) do
parent = Module.new do
def method_d
end
def method_d; end
def method_e
end
def method_e; end
end
Class.new do
extend parent
def self.method_a
end
def self.method_a; end
def self.method_b
end
def self.method_b; end
class << self; protected :method_b; end
def self.method_c
end
def self.method_c; end
private_class_method :method_c
end

View file

@ -27,6 +27,7 @@ describe Mutant::Repository::Diff do
subject { object.touches?(path, line_range) }
shared_context 'test if git tracks the file' do
# rubocop:disable Lint/UnneededSplatExpansion
before do
expect(config.kernel).to receive(:system)
.ordered

View file

@ -20,8 +20,7 @@ RSpec.describe Mutant::Subject::Method::Instance do
@bar = :boo
end
def foo
end
def foo; end
def self.name
'Test'
@ -84,8 +83,7 @@ RSpec.describe Mutant::Subject::Method::Instance::Memoized do
let(:scope) do
Class.new do
include Memoizable
def foo
end
def foo; end
memoize :foo
end
end