Skip to content

Commit

Permalink
Fix rubocop violations
Browse files Browse the repository at this point in the history
  • Loading branch information
mbj committed Dec 3, 2016
1 parent 7c3f3a5 commit 6c4e1a8
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 39 deletions.
6 changes: 3 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AllCops:
DisplayCopNames: true
Exclude:
- 'vendor/**/*'
- 'tmp/**/*'
- 'test_app/**/*'
- 'bin/mutant'
- 'tmp/**/*'
- 'vendor/**/*'
TargetRubyVersion: 2.2
2 changes: 1 addition & 1 deletion bin/mutant
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace =
.curry
.call(Kernel),
root_require: 'mutant',
includes: %w[
includes: %w[
mutant
unparser
morpher
Expand Down
3 changes: 3 additions & 0 deletions config/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,6 @@ AlignHash:
# Prefer `public_send` and `__send__` over `send`
Send:
Enabled: true

Lint/UnifiedInteger:
Enabled: false
3 changes: 1 addition & 2 deletions lib/mutant/color.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ def format(text)
# Initialize null color
#
# @return [undefined]
def initialize
end
def initialize; end

end.new

Expand Down
3 changes: 1 addition & 2 deletions lib/mutant/mutator/node/literal/nil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class Nil < self
# Emit mutations
#
# @return [undefined]
def dispatch
end
def dispatch; end

end # Nil
end # Literal
Expand Down
1 change: 1 addition & 0 deletions meta/case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
RUBY
end

# rubocop:disable Metrics/BlockLength
Mutant::Meta::Example.add :case do
source <<-RUBY
case condition
Expand Down
1 change: 1 addition & 0 deletions mutant.gemspec
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/support/xspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def self.assert_not_empty(event_list)
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
Expand Down
6 changes: 2 additions & 4 deletions spec/unit/mutant/env/bootstrap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ def self.name
# Fix Class#name so other specs do not see this one
class << invalid_class
undef :name
def name
end
def name; end
end
end

Expand Down Expand Up @@ -151,8 +150,7 @@ def self.name
# Fix Class#name so other specs do not see this one
class << invalid_class
undef :name
def name
end
def name; end
end
end

Expand Down
15 changes: 5 additions & 10 deletions spec/unit/mutant/matcher/methods/instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,25 @@

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
include parent

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

Expand Down
15 changes: 5 additions & 10 deletions spec/unit/mutant/matcher/methods/singleton_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,20 @@

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
Expand Down
1 change: 1 addition & 0 deletions spec/unit/mutant/repository/diff_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
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
Expand Down
6 changes: 2 additions & 4 deletions spec/unit/mutant/subject/method/instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ def initialize
@bar = :boo
end

def foo
end
def foo; end

def self.name
'Test'
Expand Down Expand Up @@ -84,8 +83,7 @@ def self.name
let(:scope) do
Class.new do
include Memoizable
def foo
end
def foo; end
memoize :foo
end
end
Expand Down

0 comments on commit 6c4e1a8

Please sign in to comment.