From 4bd15abeb6a5c535c333ed6af47c63a80b8c1d85 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Thu, 2 Jul 2015 03:35:54 +0000 Subject: [PATCH 1/3] Fix positioning of @api YARD tag --- lib/mutant.rb | 1 - lib/mutant/actor.rb | 3 --- lib/mutant/actor/env.rb | 2 -- lib/mutant/actor/mailbox.rb | 2 -- lib/mutant/actor/receiver.rb | 2 -- lib/mutant/actor/sender.rb | 1 - lib/mutant/ast.rb | 2 -- lib/mutant/ast/meta.rb | 5 ----- lib/mutant/ast/named_children.rb | 5 ----- lib/mutant/ast/sexp.rb | 2 -- lib/mutant/cache.rb | 2 -- lib/mutant/cli.rb | 15 +-------------- lib/mutant/color.rb | 3 --- lib/mutant/context.rb | 2 -- lib/mutant/context/scope.rb | 8 -------- lib/mutant/delegator.rb | 3 --- lib/mutant/diff.rb | 9 --------- lib/mutant/env.rb | 5 +---- lib/mutant/env/bootstrap.rb | 10 ---------- lib/mutant/expression.rb | 3 --- lib/mutant/expression/method.rb | 3 --- lib/mutant/expression/methods.rb | 4 ---- lib/mutant/expression/namespace.rb | 4 ---- lib/mutant/expression/parser.rb | 3 --- lib/mutant/integration.rb | 9 --------- lib/mutant/integration/rspec.rb | 11 +---------- lib/mutant/isolation.rb | 4 +--- lib/mutant/loader.rb | 4 +--- lib/mutant/matcher.rb | 4 +--- lib/mutant/matcher/chain.rb | 1 - lib/mutant/matcher/compiler.rb | 8 +------- lib/mutant/matcher/config.rb | 1 - lib/mutant/matcher/filter.rb | 1 - lib/mutant/matcher/method.rb | 10 ---------- lib/mutant/matcher/method/instance.rb | 3 --- lib/mutant/matcher/method/singleton.rb | 5 ----- lib/mutant/matcher/methods.rb | 10 ---------- lib/mutant/matcher/namespace.rb | 2 -- lib/mutant/matcher/null.rb | 1 - lib/mutant/matcher/scope.rb | 1 - lib/mutant/meta.rb | 1 - lib/mutant/meta/example.rb | 14 -------------- lib/mutant/meta/example/dsl.rb | 7 ------- lib/mutant/mutation.rb | 8 -------- lib/mutant/mutator.rb | 12 ------------ lib/mutant/mutator/node.rb | 16 ---------------- lib/mutant/mutator/node/and_asgn.rb | 1 - lib/mutant/mutator/node/argument.rb | 5 ----- lib/mutant/mutator/node/arguments.rb | 6 ------ lib/mutant/mutator/node/begin.rb | 2 -- lib/mutant/mutator/node/binary.rb | 3 --- lib/mutant/mutator/node/block.rb | 2 -- lib/mutant/mutator/node/break.rb | 1 - lib/mutant/mutator/node/case.rb | 3 --- lib/mutant/mutator/node/conditional_loop.rb | 1 - lib/mutant/mutator/node/const.rb | 1 - lib/mutant/mutator/node/define.rb | 1 - lib/mutant/mutator/node/defined.rb | 1 - lib/mutant/mutator/node/dstr.rb | 1 - lib/mutant/mutator/node/dsym.rb | 1 - lib/mutant/mutator/node/generic.rb | 1 - lib/mutant/mutator/node/if.rb | 4 ---- lib/mutant/mutator/node/kwbegin.rb | 1 - lib/mutant/mutator/node/literal/array.rb | 2 -- lib/mutant/mutator/node/literal/boolean.rb | 1 - lib/mutant/mutator/node/literal/fixnum.rb | 3 --- lib/mutant/mutator/node/literal/float.rb | 3 --- lib/mutant/mutator/node/literal/hash.rb | 3 --- lib/mutant/mutator/node/literal/nil.rb | 1 - lib/mutant/mutator/node/literal/range.rb | 4 ---- lib/mutant/mutator/node/literal/regex.rb | 2 -- lib/mutant/mutator/node/literal/string.rb | 1 - lib/mutant/mutator/node/literal/symbol.rb | 1 - lib/mutant/mutator/node/masgn.rb | 1 - lib/mutant/mutator/node/match_current_line.rb | 1 - lib/mutant/mutator/node/mlhs.rb | 1 - lib/mutant/mutator/node/named_value/access.rb | 1 - .../node/named_value/constant_assignment.rb | 2 -- .../node/named_value/variable_assignment.rb | 2 -- lib/mutant/mutator/node/next.rb | 1 - lib/mutant/mutator/node/noop.rb | 1 - lib/mutant/mutator/node/nthref.rb | 1 - lib/mutant/mutator/node/op_asgn.rb | 1 - lib/mutant/mutator/node/or_asgn.rb | 1 - lib/mutant/mutator/node/resbody.rb | 2 -- lib/mutant/mutator/node/rescue.rb | 5 ----- lib/mutant/mutator/node/return.rb | 1 - lib/mutant/mutator/node/send.rb | 12 ++---------- .../mutator/node/send/attribute_assignment.rb | 3 --- lib/mutant/mutator/node/send/binary.rb | 1 - lib/mutant/mutator/node/send/index.rb | 3 --- lib/mutant/mutator/node/splat.rb | 1 - lib/mutant/mutator/node/super.rb | 1 - lib/mutant/mutator/node/when.rb | 5 ----- lib/mutant/mutator/node/yield.rb | 1 - lib/mutant/mutator/node/zsuper.rb | 1 - lib/mutant/mutator/registry.rb | 5 +---- lib/mutant/mutator/util.rb | 2 -- lib/mutant/mutator/util/array.rb | 3 --- lib/mutant/mutator/util/symbol.rb | 1 - lib/mutant/parallel.rb | 6 ------ lib/mutant/parallel/master.rb | 16 ++-------------- lib/mutant/parallel/source.rb | 5 ----- lib/mutant/parallel/worker.rb | 6 +----- lib/mutant/reporter.rb | 4 ---- lib/mutant/reporter/cli.rb | 7 ------- lib/mutant/reporter/cli/format.rb | 11 ----------- lib/mutant/reporter/cli/printer.rb | 12 +----------- lib/mutant/reporter/cli/printer/config.rb | 3 +-- .../reporter/cli/printer/env_progress.rb | 5 +---- lib/mutant/reporter/cli/printer/env_result.rb | 1 - .../cli/printer/mutation_progress_result.rb | 2 -- .../reporter/cli/printer/mutation_result.rb | 8 -------- lib/mutant/reporter/cli/printer/status.rb | 3 --- .../cli/printer/status_progressive.rb | 2 -- .../reporter/cli/printer/subject_progress.rb | 5 ----- .../reporter/cli/printer/subject_result.rb | 1 - .../reporter/cli/printer/test_result.rb | 1 - lib/mutant/reporter/cli/tput.rb | 3 +++ lib/mutant/reporter/trace.rb | 2 -- lib/mutant/require_highjack.rb | 1 - lib/mutant/result.rb | 19 ------------------- lib/mutant/runner.rb | 7 ------- lib/mutant/runner/sink.rb | 8 -------- lib/mutant/selector.rb | 1 - lib/mutant/selector/expression.rb | 1 - lib/mutant/subject.rb | 11 ----------- lib/mutant/subject/method.rb | 5 ----- lib/mutant/subject/method/instance.rb | 4 ---- lib/mutant/subject/method/singleton.rb | 2 -- lib/mutant/test.rb | 1 - lib/mutant/warning_filter.rb | 5 ----- lib/mutant/zombifier.rb | 12 +++++------- spec/support/corpus.rb | 8 ++------ spec/support/rb_bug.rb | 1 - spec/support/rspec.rb | 1 - 136 files changed, 26 insertions(+), 512 deletions(-) diff --git a/lib/mutant.rb b/lib/mutant.rb index 0c8a2969..8348d9f9 100644 --- a/lib/mutant.rb +++ b/lib/mutant.rb @@ -33,7 +33,6 @@ module Mutant # @return [Boolean] # # @api private - # def self.ci? ENV.key?('CI') end diff --git a/lib/mutant/actor.rb b/lib/mutant/actor.rb index 80a28b66..58cfdb62 100644 --- a/lib/mutant/actor.rb +++ b/lib/mutant/actor.rb @@ -15,7 +15,6 @@ module Mutant # @return [String] # # @api private - # def inspect INSPECT end @@ -33,7 +32,6 @@ module Mutant # @return [Message] # # @api private - # def self.new(_type, _payload = Undefined) super end @@ -51,7 +49,6 @@ module Mutant # @return [Object] # # @api private - # def call(type) other.call(Message.new(type, mailbox.sender)) message = mailbox.receiver.call diff --git a/lib/mutant/actor/env.rb b/lib/mutant/actor/env.rb index 7a0cbdea..eaaecff7 100644 --- a/lib/mutant/actor/env.rb +++ b/lib/mutant/actor/env.rb @@ -9,7 +9,6 @@ module Mutant # @return [Actor::Sender] # # @api private - # def spawn mailbox = new_mailbox @@ -25,7 +24,6 @@ module Mutant # @return [Mailbox] # # @api private - # def new_mailbox Mailbox.new end diff --git a/lib/mutant/actor/mailbox.rb b/lib/mutant/actor/mailbox.rb index 4430e587..40dea502 100644 --- a/lib/mutant/actor/mailbox.rb +++ b/lib/mutant/actor/mailbox.rb @@ -9,7 +9,6 @@ module Mutant # @return [Mailbox] # # @api private - # def self.new mutex = Mutex.new condition_variable = ConditionVariable.new @@ -28,7 +27,6 @@ module Mutant # @return [Binding] # # @api private - # def bind(other) Binding.new(self, other) end diff --git a/lib/mutant/actor/receiver.rb b/lib/mutant/actor/receiver.rb index 39aa6f01..e3034abc 100644 --- a/lib/mutant/actor/receiver.rb +++ b/lib/mutant/actor/receiver.rb @@ -9,7 +9,6 @@ module Mutant # @return [Object] # # @api private - # def call 2.times do message = try_blocking_receive @@ -29,7 +28,6 @@ module Mutant # if there is a message # # @api private - # def try_blocking_receive mutex.synchronize do if messages.empty? diff --git a/lib/mutant/actor/sender.rb b/lib/mutant/actor/sender.rb index c42f29e5..19b54676 100644 --- a/lib/mutant/actor/sender.rb +++ b/lib/mutant/actor/sender.rb @@ -12,7 +12,6 @@ module Mutant # @return [self] # # @api private - # def call(message) mutex.synchronize do messages << message diff --git a/lib/mutant/ast.rb b/lib/mutant/ast.rb index 37b12b1b..78c56f33 100644 --- a/lib/mutant/ast.rb +++ b/lib/mutant/ast.rb @@ -16,7 +16,6 @@ module Mutant # otherwise # # @api private - # def self.find_last_path(node, &predicate) fail ArgumentError, 'block expected' unless block_given? path = [] @@ -39,7 +38,6 @@ module Mutant # @return [undefined] # # @api private - # def self.walk(node, stack, &block) block.call(node, stack) node.children.grep(Parser::AST::Node) do |child| diff --git a/lib/mutant/ast/meta.rb b/lib/mutant/ast/meta.rb index af2955a9..8c28e3eb 100644 --- a/lib/mutant/ast/meta.rb +++ b/lib/mutant/ast/meta.rb @@ -24,7 +24,6 @@ module Mutant # @return [Enumerable] # # @api private - # alias_method :arguments, :remaining_children # Test if AST node is a valid assignment target @@ -32,7 +31,6 @@ module Mutant # @return [Boolean] # # @api private - # def assignment? index_assignment? || attribute_assignment? end @@ -42,7 +40,6 @@ module Mutant # @return [Boolean] # # @api private - # def attribute_assignment? !Types::METHOD_OPERATORS.include?(selector) && selector.to_s.end_with?(ATTRIBUTE_ASSIGNMENT_SELECTOR_SUFFIX) @@ -53,7 +50,6 @@ module Mutant # @return [Boolean] # # @api private - # def index_assignment? selector.equal?(INDEX_ASSIGNMENT_SELECTOR) end @@ -63,7 +59,6 @@ module Mutant # @return [Boolean] # # @api private - # def binary_method_operator? Types::BINARY_METHOD_OPERATORS.include?(selector) end diff --git a/lib/mutant/ast/named_children.rb b/lib/mutant/ast/named_children.rb index 238ba2b9..a94d0b30 100644 --- a/lib/mutant/ast/named_children.rb +++ b/lib/mutant/ast/named_children.rb @@ -11,7 +11,6 @@ module Mutant # @return [undefined] # # @api private - # def self.included(host) host.class_eval do include InstanceMethods @@ -29,7 +28,6 @@ module Mutant # @return [Array exception @@ -33,7 +32,6 @@ module Mutant # @return [undefined] # # @api private - # def initialize(arguments) @config = Config::DEFAULT @@ -45,7 +43,6 @@ module Mutant # @return [Config] # # @api private - # attr_reader :config private @@ -61,7 +58,6 @@ module Mutant # @return [undefined] # # @api private - # def parse(arguments) opts = OptionParser.new do |builder| builder.banner = 'usage: mutant [options] MATCH_EXPRESSION ...' @@ -82,7 +78,6 @@ module Mutant # @return [undefined] # # @api private - # def parse_match_expressions(expressions) fail Error, 'No expressions given' if expressions.empty? @@ -97,10 +92,9 @@ module Mutant # # @return [undefined] # - # @api private - # # rubocop:disable MethodLength # + # @api private def add_environment_options(opts) opts.separator('Environment:') opts.on('--zombie', 'Run mutant zombified') do @@ -124,7 +118,6 @@ module Mutant # @return [undefined] # # @api private - # def setup_integration(name) update(integration: Integration.setup(name)) rescue LoadError @@ -138,7 +131,6 @@ module Mutant # @return [undefined] # # @api private - # def add_mutation_options(opts) opts.separator(nil) opts.separator('Options:') @@ -159,7 +151,6 @@ module Mutant # @return [undefined] # # @api private - # def add_filter_options(opts) opts.on('--ignore-subject PATTERN', 'Ignore subjects that match PATTERN') do |pattern| add_matcher(:subject_ignores, config.expression_parser.(pattern)) @@ -173,7 +164,6 @@ module Mutant # @return [undefined] # # @api private - # def add_debug_options(opts) opts.on('--fail-fast', 'Fail fast') do update(fail_fast: true) @@ -198,7 +188,6 @@ module Mutant # @return [undefined] # # @api private - # def update(attributes) @config = @config.update(attributes) end @@ -214,7 +203,6 @@ module Mutant # @return [undefined] # # @api private - # def add(attribute, value) update(attribute => config.public_send(attribute).dup << value) end @@ -230,7 +218,6 @@ module Mutant # @return [undefined] # # @api private - # def add_matcher(attribute, value) update(matcher: config.matcher.add(attribute, value)) end diff --git a/lib/mutant/color.rb b/lib/mutant/color.rb index 3df471f0..8d1c1636 100644 --- a/lib/mutant/color.rb +++ b/lib/mutant/color.rb @@ -10,7 +10,6 @@ module Mutant # @return [String] # # @api private - # def format(text) "\e[#{@code}m#{text}\e[0m" end @@ -25,7 +24,6 @@ module Mutant # the argument string # # @api private - # def format(text) text end @@ -37,7 +35,6 @@ module Mutant # @return [undefined] # # @api private - # def initialize end diff --git a/lib/mutant/context.rb b/lib/mutant/context.rb index aa088a77..54ab50f9 100644 --- a/lib/mutant/context.rb +++ b/lib/mutant/context.rb @@ -10,7 +10,6 @@ module Mutant # @return [Parser::AST::Node] # # @api private - # abstract_method :root # Return identification @@ -18,7 +17,6 @@ module Mutant # @return [String] # # @api private - # abstract_method :identification end # Context diff --git a/lib/mutant/context/scope.rb b/lib/mutant/context/scope.rb index 2d70f559..442eb336 100644 --- a/lib/mutant/context/scope.rb +++ b/lib/mutant/context/scope.rb @@ -12,7 +12,6 @@ module Mutant # @return [Parser::AST::Node] # # @api private - # def root(node) nesting.reverse.reduce(node) do |current, scope| self.class.wrap(scope, current) @@ -24,7 +23,6 @@ module Mutant # @return [String] # # @api private - # def identification scope.name end @@ -41,7 +39,6 @@ module Mutant # if scope is of kind module # # @api private - # def self.wrap(scope, node) name = s(:const, nil, scope.name.split(NAMESPACE_DELIMITER).last.to_sym) case scope @@ -59,7 +56,6 @@ module Mutant # @return [Enumerable] # # @api private - # def nesting const = ::Object name_nesting.each_with_object([]) do |name, nesting| @@ -74,7 +70,6 @@ module Mutant # @return [String] # # @api private - # def unqualified_name name_nesting.last end @@ -84,7 +79,6 @@ module Mutant # @return [Enumerable] # # @api private - # def match_expressions name_nesting.each_index.reverse_each.map do |index| Expression::Namespace::Recursive.new( @@ -99,7 +93,6 @@ module Mutant # @return [::Module|::Class] # # @api private - # attr_reader :scope private @@ -109,7 +102,6 @@ module Mutant # @return [Array] # # @api private - # def name_nesting scope.name.split(NAMESPACE_DELIMITER) end diff --git a/lib/mutant/delegator.rb b/lib/mutant/delegator.rb index 40bd6e94..6d1918cc 100644 --- a/lib/mutant/delegator.rb +++ b/lib/mutant/delegator.rb @@ -11,7 +11,6 @@ module Mutant # @return [undefined] # # @api private - # def delegate(*names) names.each(&method(:define_delegator)) end @@ -23,7 +22,6 @@ module Mutant # @return [undefined] # # @api private - # def define_delegator(name) fail "method #{name} already defined" if instance_methods.include?(name) define_method(name) do @@ -41,7 +39,6 @@ module Mutant # @return [undefined] # # @api private - # def self.included(host) super diff --git a/lib/mutant/diff.rb b/lib/mutant/diff.rb index 72d6b1c6..16cf848b 100644 --- a/lib/mutant/diff.rb +++ b/lib/mutant/diff.rb @@ -16,7 +16,6 @@ module Mutant # otherwise # # @api private - # def diff return if diffs.empty? @@ -35,7 +34,6 @@ module Mutant # otherwise # # @api private - # def colorized_diff return unless diff diff.lines.map(&self.class.method(:colorize_line)).join @@ -50,7 +48,6 @@ module Mutant # @return [Diff] # # @api private - # def self.build(old, new) new(lines(old), lines(new)) end @@ -62,7 +59,6 @@ module Mutant # @return [Array] # # @api private - # def self.lines(source) source.lines.map(&:chomp) end @@ -75,7 +71,6 @@ module Mutant # @return [Array] # # @api private - # def diffs ::Diff::LCS.diff(old, new) end @@ -85,7 +80,6 @@ module Mutant # @return [Array] # # @api private - # def hunks diffs.map do |diff| ::Diff::LCS::Hunk.new(old, new, diff, max_length, 0) @@ -97,7 +91,6 @@ module Mutant # @return [Array] # # @api private - # def minimized_hunks head, *tail = hunks @@ -116,7 +109,6 @@ module Mutant # @return [Fixnum] # # @api private - # def max_length [old, new].map(&:length).max end @@ -128,7 +120,6 @@ module Mutant # @return [String] # # @api private - # def self.colorize_line(line) case line[0] when ADDITION diff --git a/lib/mutant/env.rb b/lib/mutant/env.rb index efda8b76..276481aa 100644 --- a/lib/mutant/env.rb +++ b/lib/mutant/env.rb @@ -23,7 +23,6 @@ module Mutant # @return [self] # # @api private - # def warn(message) config.reporter.warn(message) self @@ -36,7 +35,6 @@ module Mutant # @return [Result::Mutation] # # @api private - # def kill(mutation) test_result = run_mutation_tests(mutation) Result::Mutation.new( @@ -54,10 +52,9 @@ module Mutant # # @return [Result::Test] # - # @api private - # # rubocop:disable MethodLength # + # @api private def run_mutation_tests(mutation) start = Time.now tests = selector.call(mutation.subject) diff --git a/lib/mutant/env/bootstrap.rb b/lib/mutant/env/bootstrap.rb index fdd23bc2..3cdfc175 100644 --- a/lib/mutant/env/bootstrap.rb +++ b/lib/mutant/env/bootstrap.rb @@ -13,7 +13,6 @@ module Mutant # @return [Enumerable] # # @api private - # attr_reader :matchable_scopes # Return new bootstrap env @@ -21,7 +20,6 @@ module Mutant # @return [Env] # # @api private - # def self.new(_config, _cache = Cache.new) super end @@ -31,7 +29,6 @@ module Mutant # @return [Object] # # @api private - # def initialize(*) super infect @@ -45,7 +42,6 @@ module Mutant # @return [self] # # @api private - # def warn(message) config.reporter.warn(message) self @@ -56,7 +52,6 @@ module Mutant # @return [Env] # # @api private - # # rubocop:disable MethodLength # def env @@ -86,7 +81,6 @@ module Mutant # otherwise # # @api private - # def scope_name(scope) scope.name rescue => exception @@ -99,7 +93,6 @@ module Mutant # @return [undefined] # # @api private - # def infect config.includes.each(&$LOAD_PATH.method(:<<)) config.requires.each(&method(:require)) @@ -111,7 +104,6 @@ module Mutant # @return [Enumerable] # # @api private - # def matched_subjects Matcher::Compiler.call(self, config.matcher).to_a end @@ -121,7 +113,6 @@ module Mutant # @return [undefined] # # @api private - # def initialize_matchable_scopes scopes = ObjectSpace.each_object(Module).each_with_object([]) do |scope, aggregate| expression = expression(scope) @@ -142,7 +133,6 @@ module Mutant # otherwise # # @api private - # def expression(scope) name = scope_name(scope) or return diff --git a/lib/mutant/expression.rb b/lib/mutant/expression.rb index 92b8fd35..f6e680d2 100644 --- a/lib/mutant/expression.rb +++ b/lib/mutant/expression.rb @@ -15,7 +15,6 @@ module Mutant # @return [String] # # @api private - # abstract_method :syntax # Return match length for expression @@ -25,7 +24,6 @@ module Mutant # @return [Fixnum] # # @api private - # def match_length(other) if eql?(other) syntax.length @@ -41,7 +39,6 @@ module Mutant # @return [Boolean] # # @api private - # def prefix?(other) !match_length(other).zero? end diff --git a/lib/mutant/expression/method.rb b/lib/mutant/expression/method.rb index c4cef2d6..43a17f10 100644 --- a/lib/mutant/expression/method.rb +++ b/lib/mutant/expression/method.rb @@ -25,7 +25,6 @@ module Mutant # @return [String] # # @api private - # def syntax [scope_name, scope_symbol, method_name].join end @@ -38,7 +37,6 @@ module Mutant # @return [Matcher] # # @api private - # def matcher(env) methods_matcher = MATCHERS.fetch(scope_symbol).new(env, scope) @@ -52,7 +50,6 @@ module Mutant # @return [Class, Method] # # @api private - # def scope Object.const_get(scope_name) end diff --git a/lib/mutant/expression/methods.rb b/lib/mutant/expression/methods.rb index a2642ddf..a32f650b 100644 --- a/lib/mutant/expression/methods.rb +++ b/lib/mutant/expression/methods.rb @@ -19,7 +19,6 @@ module Mutant # @return [String] # # @api private - # def syntax [scope_name, scope_symbol].join end @@ -32,7 +31,6 @@ module Mutant # @return [Matcher::Method] # # @api private - # def matcher(env) MATCHERS.fetch(scope_symbol).new(env, scope) end @@ -44,7 +42,6 @@ module Mutant # @return [Fixnum] # # @api private - # def match_length(expression) if expression.syntax.start_with?(syntax) syntax.length @@ -60,7 +57,6 @@ module Mutant # @return [Class, Method] # # @api private - # def scope Object.const_get(scope_name) end diff --git a/lib/mutant/expression/namespace.rb b/lib/mutant/expression/namespace.rb index ab750b6b..44d2a79d 100644 --- a/lib/mutant/expression/namespace.rb +++ b/lib/mutant/expression/namespace.rb @@ -28,7 +28,6 @@ module Mutant # @return [String] # # @api private - # def syntax "#{scope_name}*" end @@ -41,7 +40,6 @@ module Mutant # @return [Matcher] # # @api private - # def matcher(env) Matcher::Namespace.new(env, self) end @@ -53,7 +51,6 @@ module Mutant # @return [Fixnum] # # @api private - # def match_length(expression) if @recursion_pattern =~ expression.syntax scope_name.length @@ -79,7 +76,6 @@ module Mutant # @return [Matcher] # # @api private - # def matcher(env) Matcher::Scope.new(env, Object.const_get(scope_name), self) end diff --git a/lib/mutant/expression/parser.rb b/lib/mutant/expression/parser.rb index 75e8c29a..677586d2 100644 --- a/lib/mutant/expression/parser.rb +++ b/lib/mutant/expression/parser.rb @@ -24,7 +24,6 @@ module Mutant # otherwise # # @api private - # def call(input) try_parse(input) or fail InvalidExpressionError, "Expression: #{input.inspect} is not valid" end @@ -40,7 +39,6 @@ module Mutant # otherwise # # @api private - # def try_parse(input) expressions = expressions(input) case expressions.length @@ -61,7 +59,6 @@ module Mutant # if expressions can be parsed from input # # @api private - # def expressions(input) types.each_with_object([]) do |type, aggregate| expression = type.try_parse(input) diff --git a/lib/mutant/integration.rb b/lib/mutant/integration.rb index ff2e7e03..20f8c92a 100644 --- a/lib/mutant/integration.rb +++ b/lib/mutant/integration.rb @@ -13,7 +13,6 @@ module Mutant # @return [Integration] # # @api private - # def self.setup(name) require "mutant/integration/#{name}" lookup(name) @@ -27,7 +26,6 @@ module Mutant # if found # # @api private - # def self.lookup(name) REGISTRY.fetch(name) end @@ -39,7 +37,6 @@ module Mutant # @return [undefined] # # @api private - # def self.register(name) REGISTRY[name] = self end @@ -50,7 +47,6 @@ module Mutant # @return [self] # # @api private - # def setup self end @@ -62,7 +58,6 @@ module Mutant # @return [Result::Test] # # @api private - # abstract_method :call # Return all available tests by integration @@ -70,7 +65,6 @@ module Mutant # @return [Enumerable] # # @api private - # abstract_method :all_tests private @@ -80,7 +74,6 @@ module Mutant # @return [Expression::Parser] # # @api private - # def expression_parser config.expression_parser end @@ -95,7 +88,6 @@ module Mutant # @return [Enumerable] # # @api private - # def all_tests EMPTY_ARRAY end @@ -107,7 +99,6 @@ module Mutant # @return [Result::Test] # # @api private - # def call(tests) Result::Test.new( tests: tests, diff --git a/lib/mutant/integration/rspec.rb b/lib/mutant/integration/rspec.rb index ffad42e4..0434ca7b 100644 --- a/lib/mutant/integration/rspec.rb +++ b/lib/mutant/integration/rspec.rb @@ -34,7 +34,6 @@ module Mutant # @return [undefined] # # @api private - # def initialize(*) super @output = StringIO.new @@ -47,7 +46,6 @@ module Mutant # @return [self] # # @api private - # def setup @runner.setup($stderr, @output) self @@ -60,10 +58,9 @@ module Mutant # # @return [Result::Test] # - # @api private - # # rubocop:disable MethodLength # + # @api private def call(tests) examples = tests.map(&all_tests_index.method(:fetch)) filter_examples(&examples.method(:include?)) @@ -83,7 +80,6 @@ module Mutant # @return [Enumerable] # # @api private - # def all_tests all_tests_index.keys end @@ -96,7 +92,6 @@ module Mutant # @return [Hash exception @@ -35,10 +34,9 @@ module Mutant # @raise [Error] # if block terminates abnormal # - # @api private - # # rubocop:disable MethodLength # + # @api private def self.call(&block) reader, writer = IO.pipe.map(&:binmode) diff --git a/lib/mutant/loader.rb b/lib/mutant/loader.rb index 4744ffd9..05e67dd1 100644 --- a/lib/mutant/loader.rb +++ b/lib/mutant/loader.rb @@ -10,12 +10,11 @@ module Mutant # # @return [undefined] # - # @api private - # # One off the very few valid uses of eval # # rubocop:disable Lint/Eval # + # @api private def call eval( source, @@ -33,7 +32,6 @@ module Mutant # @return [String] # # @api private - # def source Unparser.unparse(root) end diff --git a/lib/mutant/matcher.rb b/lib/mutant/matcher.rb index a5111bff..d555c22c 100644 --- a/lib/mutant/matcher.rb +++ b/lib/mutant/matcher.rb @@ -11,21 +11,19 @@ module Mutant # @return [undefined] # # @api private - # def self.build(*arguments) new(*arguments) end # Enumerate subjects # - # @api private - # # @return [self] # if block given # # @return [Enumerable] # otherwise # + # @api private abstract_method :each end # Matcher diff --git a/lib/mutant/matcher/chain.rb b/lib/mutant/matcher/chain.rb index ee6f5fb8..702b07b8 100644 --- a/lib/mutant/matcher/chain.rb +++ b/lib/mutant/matcher/chain.rb @@ -13,7 +13,6 @@ module Mutant # otherwise # # @api private - # def each(&block) return to_enum unless block_given? diff --git a/lib/mutant/matcher/compiler.rb b/lib/mutant/matcher/compiler.rb index 8c7e8fa5..23080664 100644 --- a/lib/mutant/matcher/compiler.rb +++ b/lib/mutant/matcher/compiler.rb @@ -10,7 +10,6 @@ module Mutant # @return [Mutant::Matcher] # # @api private - # def result Filter.new( Chain.build(config.match_expressions.map(&method(:matcher))), @@ -27,7 +26,6 @@ module Mutant # @return [Boolean] # # @api private - # def call(subject) expression.prefix?(subject.expression) end @@ -40,10 +38,9 @@ module Mutant # # @return [#call] # - # @api private - # # rubocop:disable MethodLength # + # @api private def predicate if subject_selector && subject_rejector Morpher::Evaluator::Predicate::Boolean::And.new([ @@ -68,7 +65,6 @@ module Mutant # otherwise # # @api private - # def subject_selector selectors = config.subject_selects.map do |attribute, value| Morpher.compile(s(:eql, s(:attribute, attribute), s(:static, value))) @@ -86,7 +82,6 @@ module Mutant # otherwise # # @api private - # def subject_rejector rejectors = config.subject_ignores.map(&SubjectPrefix.method(:new)) @@ -100,7 +95,6 @@ module Mutant # @return [Matcher] # # @api private - # def matcher(expression) expression.matcher(env) end diff --git a/lib/mutant/matcher/config.rb b/lib/mutant/matcher/config.rb index 93e90ca8..5af5be5d 100644 --- a/lib/mutant/matcher/config.rb +++ b/lib/mutant/matcher/config.rb @@ -18,7 +18,6 @@ module Mutant # @return [Config] # # @api private - # def add(attribute, value) update(attribute => public_send(attribute).dup << value) end diff --git a/lib/mutant/matcher/filter.rb b/lib/mutant/matcher/filter.rb index 885c89fb..bc750438 100644 --- a/lib/mutant/matcher/filter.rb +++ b/lib/mutant/matcher/filter.rb @@ -25,7 +25,6 @@ module Mutant # otherwise # # @api private - # def each(&block) return to_enum unless block_given? matcher.select(&predicate.method(:call)).each(&block) diff --git a/lib/mutant/matcher/method.rb b/lib/mutant/matcher/method.rb index e02f1e40..a7e6f27e 100644 --- a/lib/mutant/matcher/method.rb +++ b/lib/mutant/matcher/method.rb @@ -18,7 +18,6 @@ module Mutant # otherwise # # @api private - # def each return to_enum unless block_given? @@ -36,7 +35,6 @@ module Mutant # @return [Boolean] # # @api private - # def skip? location = source_location if location.nil? || BLACKLIST.match(location.first) @@ -55,7 +53,6 @@ module Mutant # @return [String] # # @api private - # def method_name target_method.name end @@ -65,7 +62,6 @@ module Mutant # @return [Context::Scope] # # @api private - # def context Context::Scope.new(scope, source_path) end @@ -75,7 +71,6 @@ module Mutant # @return [Parser::AST::Node] # # @api private - # def ast env.cache.parse(source_path) end @@ -85,7 +80,6 @@ module Mutant # @return [String] # # @api private - # def source_path source_location.first end @@ -95,7 +89,6 @@ module Mutant # @return [Integer] # # @api private - # def source_line source_location.last end @@ -105,7 +98,6 @@ module Mutant # @return [Array] # # @api private - # def source_location target_method.source_location end @@ -119,7 +111,6 @@ module Mutant # otherwise # # @api private - # def subject node = matched_node_path.last return unless node @@ -132,7 +123,6 @@ module Mutant # @return [Array] # # @api private - # def matched_node_path AST.find_last_path(ast, &method(:match?)) end diff --git a/lib/mutant/matcher/method/instance.rb b/lib/mutant/matcher/method/instance.rb index 04f48788..2a6ac31c 100644 --- a/lib/mutant/matcher/method/instance.rb +++ b/lib/mutant/matcher/method/instance.rb @@ -14,7 +14,6 @@ module Mutant # @return [Matcher::Method::Instance] # # @api private - # def self.build(env, scope, target_method) name = target_method.name if scope.ancestors.include?(::Memoizable) && scope.memoized?(name) @@ -34,7 +33,6 @@ module Mutant # @return [Boolean] # # @api private - # def match?(node) location = node.location || return expression = location.expression || return @@ -55,7 +53,6 @@ module Mutant # @return [Array] # # @api private - # def source_location scope.unmemoized_instance_method(method_name).source_location end diff --git a/lib/mutant/matcher/method/singleton.rb b/lib/mutant/matcher/method/singleton.rb index d593c9d7..b0c4dfe7 100644 --- a/lib/mutant/matcher/method/singleton.rb +++ b/lib/mutant/matcher/method/singleton.rb @@ -16,7 +16,6 @@ module Mutant # @return [Boolean] # # @api private - # def match?(node) line?(node) && name?(node) && receiver?(node) end @@ -28,7 +27,6 @@ module Mutant # @return [Boolean] # # @api private - # def line?(node) expression = node.location.expression return false unless expression @@ -42,7 +40,6 @@ module Mutant # @return [Boolean] # # @api private - # def name?(node) node.children[NAME_INDEX].equal?(method_name) end @@ -54,7 +51,6 @@ module Mutant # @return [Boolean] # # @api private - # def receiver?(node) receiver = node.children[RECEIVER_INDEX] case receiver.type @@ -75,7 +71,6 @@ module Mutant # @return [Boolean] # # @api private - # def receiver_name?(node) name = node.children[NAME_INDEX] name.to_s.eql?(context.unqualified_name) diff --git a/lib/mutant/matcher/methods.rb b/lib/mutant/matcher/methods.rb index ea84135c..d661dc0c 100644 --- a/lib/mutant/matcher/methods.rb +++ b/lib/mutant/matcher/methods.rb @@ -13,7 +13,6 @@ module Mutant # otherwise # # @api private - # def each(&block) return to_enum unless block_given? @@ -29,7 +28,6 @@ module Mutant # @return [Class:Matcher::Method] # # @api private - # def matcher self.class::MATCHER end @@ -39,7 +37,6 @@ module Mutant # @return [Enumerable] # # @api private - # def methods candidate_names.each_with_object([]) do |name, methods| method = access(name) @@ -53,7 +50,6 @@ module Mutant # @return [Array] # # @api private - # def subjects methods.map do |method| matcher.build(env, scope, method) @@ -66,7 +62,6 @@ module Mutant # @return [Enumerable] # # @api private - # def candidate_names ( candidate_scope.public_instance_methods(false) + @@ -80,7 +75,6 @@ module Mutant # @return [Class, Module] # # @api private - # abstract_method :candidate_scope # Matcher for singleton methods @@ -96,7 +90,6 @@ module Mutant # @return [Method] # # @api private - # def access(method_name) scope.method(method_name) end @@ -106,7 +99,6 @@ module Mutant # @return [Class] # # @api private - # def candidate_scope scope.singleton_class end @@ -127,7 +119,6 @@ module Mutant # @return [UnboundMethod] # # @api private - # def access(method_name) scope.instance_method(method_name) end @@ -137,7 +128,6 @@ module Mutant # @return [Class, Module] # # @api private - # def candidate_scope scope end diff --git a/lib/mutant/matcher/namespace.rb b/lib/mutant/matcher/namespace.rb index 825d7b2c..ca10019e 100644 --- a/lib/mutant/matcher/namespace.rb +++ b/lib/mutant/matcher/namespace.rb @@ -14,7 +14,6 @@ module Mutant # otherwise # # @api private - # def each(&block) return to_enum unless block_given? @@ -34,7 +33,6 @@ module Mutant # @return [Boolean] # # @api private - # def match?(scope) expression.prefix?(scope.expression) end diff --git a/lib/mutant/matcher/null.rb b/lib/mutant/matcher/null.rb index a4cc3fd1..fe7a9864 100644 --- a/lib/mutant/matcher/null.rb +++ b/lib/mutant/matcher/null.rb @@ -13,7 +13,6 @@ module Mutant # otherwise # # @api private - # def each return to_enum unless block_given? self diff --git a/lib/mutant/matcher/scope.rb b/lib/mutant/matcher/scope.rb index 49a8752c..9d9414d9 100644 --- a/lib/mutant/matcher/scope.rb +++ b/lib/mutant/matcher/scope.rb @@ -18,7 +18,6 @@ module Mutant # otherwise # # @api private - # def each(&block) return to_enum unless block_given? diff --git a/lib/mutant/meta.rb b/lib/mutant/meta.rb index dd882487..eeda9a25 100644 --- a/lib/mutant/meta.rb +++ b/lib/mutant/meta.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def self.add(&block) file = caller.first.split(':in', 2).first ALL << DSL.run(file, block) diff --git a/lib/mutant/meta/example.rb b/lib/mutant/meta/example.rb index 8eedcda1..8e5b2c7f 100644 --- a/lib/mutant/meta/example.rb +++ b/lib/mutant/meta/example.rb @@ -8,7 +8,6 @@ module Mutant # @return [Verification] # # @api private - # def verification Verification.new(self, generated) end @@ -18,7 +17,6 @@ module Mutant # @return [String] # # @api private - # def source Unparser.unparse(node) end @@ -29,7 +27,6 @@ module Mutant # @return [Enumerable] # # @api private - # def generated Mutator.each(node).map do |node| Mutation::Evil.new(self, node) @@ -46,7 +43,6 @@ module Mutant # @return [Boolean] # # @api private - # def success? unparser.success? && missing.empty? && unexpected.empty? && no_diffs.empty? end @@ -56,7 +52,6 @@ module Mutant # @return [String] # # @api private - # def error_report unless unparser.success? return unparser.report @@ -71,7 +66,6 @@ module Mutant # @return [Array] # # @api private - # def unexpected mutations.map(&:node) - example.mutations end @@ -82,7 +76,6 @@ module Mutant # @return [Enumerable] # # @api private - # def no_diffs mutations.select { |mutation| mutation.source.eql?(example.source) } end @@ -93,7 +86,6 @@ module Mutant # @return [String] # # @api private - # def mutation_report original_node = example.node [ @@ -112,7 +104,6 @@ module Mutant # @return [Array, nil] # # @api private - # def missing_report [ 'Missing mutations:', @@ -125,7 +116,6 @@ module Mutant # @return [Array, nil] # # @api private - # def no_diff_report [ 'No source diffs to original:', @@ -140,7 +130,6 @@ module Mutant # @return [Array, nil] # # @api private - # def unexpected_report [ 'Unexpected mutations:', @@ -153,7 +142,6 @@ module Mutant # @return [String] # # @api private - # def format_mutation(node) [ node.inspect, @@ -166,7 +154,6 @@ module Mutant # @return [Array] # # @api private - # def missing example.mutations - mutations.map(&:node) end @@ -177,7 +164,6 @@ module Mutant # @return [Unparser::CLI::Source] # # @api private - # def unparser Unparser::CLI::Source::Node.new(Unparser::Preprocessor.run(example.node)) end diff --git a/lib/mutant/meta/example/dsl.rb b/lib/mutant/meta/example/dsl.rb index ca8cc339..363a0751 100644 --- a/lib/mutant/meta/example/dsl.rb +++ b/lib/mutant/meta/example/dsl.rb @@ -11,7 +11,6 @@ module Mutant # @return [Example] # # @api private - # def self.run(file, block) instance = new(file) instance.instance_eval(&block) @@ -23,7 +22,6 @@ module Mutant # @return [undefined] # # @api private - # def initialize(file) @file = file @source = nil @@ -38,7 +36,6 @@ module Mutant # in case example cannot be build # # @api private - # def example fail 'source not defined' unless @source Example.new(@file, @source, @expected) @@ -53,7 +50,6 @@ module Mutant # @return [self] # # @api private - # def source(input) fail 'source already defined' if @source @source = node(input) @@ -68,7 +64,6 @@ module Mutant # @return [self] # # @api private - # def mutation(input) node = node(input) if @expected.include?(node) @@ -84,7 +79,6 @@ module Mutant # @return [undefined] # # @api private - # def singleton_mutations mutation('nil') mutation('self') @@ -100,7 +94,6 @@ module Mutant # in case input cannot be coerced # # @api private - # def node(input) case input when String diff --git a/lib/mutant/mutation.rb b/lib/mutant/mutation.rb index e3eeb0b9..34129b35 100644 --- a/lib/mutant/mutation.rb +++ b/lib/mutant/mutation.rb @@ -12,7 +12,6 @@ module Mutant # @return [String] # # @api private - # def identification "#{self.class::SYMBOL}:#{subject.identification}:#{code}" end @@ -23,7 +22,6 @@ module Mutant # @return [String] # # @api private - # def code sha1[CODE_RANGE] end @@ -34,7 +32,6 @@ module Mutant # @return [String] # # @api private - # def source Unparser.unparse(node) end @@ -45,7 +42,6 @@ module Mutant # @return [String] # # @api private - # def original_source subject.source end @@ -57,7 +53,6 @@ module Mutant # @return [Boolean] # # @api private - # def self.success?(test_result) self::TEST_PASS_SUCCESS.equal?(test_result.passed) end @@ -71,7 +66,6 @@ module Mutant # @return [self] # # @api private - # def insert subject.public? subject.prepare @@ -86,7 +80,6 @@ module Mutant # @return [String] # # @api private - # def sha1 Digest::SHA1.hexdigest(subject.identification + CODE_DELIMITER + source) end @@ -97,7 +90,6 @@ module Mutant # @return [Parser::AST::Node] # # @api private - # def root subject.context.root(node) end diff --git a/lib/mutant/mutator.rb b/lib/mutant/mutator.rb index a2608315..10c9c03a 100644 --- a/lib/mutant/mutator.rb +++ b/lib/mutant/mutator.rb @@ -13,7 +13,6 @@ module Mutant # @return [self] # # @api private - # def self.each(input, parent = nil, &block) return to_enum(__method__, input, parent) unless block_given? REGISTRY.lookup(input).new(input, parent, block) @@ -26,7 +25,6 @@ module Mutant # @return [undefined] # # @api private - # def self.handle(*types) types.each do |type| REGISTRY.register(type, self) @@ -39,7 +37,6 @@ module Mutant # @return [Object] # # @api private - # attr_reader :input # Return input @@ -47,7 +44,6 @@ module Mutant # @return [Object] # # @api private - # attr_reader :parent private @@ -61,7 +57,6 @@ module Mutant # @return [undefined] # # @api private - # def initialize(input, parent, block) @input, @parent, @block = input, parent, block @seen = Set.new @@ -76,7 +71,6 @@ module Mutant # @return [Boolean] # # @api private - # def new?(object) !@seen.include?(object) end @@ -88,7 +82,6 @@ module Mutant # @return [undefined] # # @api private - # def guard(object) @seen << object end @@ -98,7 +91,6 @@ module Mutant # @return [undefined] # # @api private - # abstract_method :dispatch # Emit generated mutation if object is not equivalent to input @@ -108,7 +100,6 @@ module Mutant # @return [undefined] # # @api private - # def emit(object) return unless new?(object) @@ -124,7 +115,6 @@ module Mutant # @return [self] # # @api private - # def emit!(node) @block.call(node) self @@ -135,7 +125,6 @@ module Mutant # @return [undefined] # # @api private - # def run(mutator) mutator.new(input, self, method(:emit)) end @@ -145,7 +134,6 @@ module Mutant # @return [Object] # # @api private - # def dup_input input.dup end diff --git a/lib/mutant/mutator/node.rb b/lib/mutant/mutator/node.rb index 6f6cc543..6faa3de9 100644 --- a/lib/mutant/mutator/node.rb +++ b/lib/mutant/mutator/node.rb @@ -19,7 +19,6 @@ module Mutant # @return [undefined] # # @api private - # def self.define_named_child(name, index) super @@ -40,7 +39,6 @@ module Mutant # @return [Parser::AST::Node] # # @api private - # alias_method :node, :input # Return duplicated node @@ -48,7 +46,6 @@ module Mutant # @return [Parser::AST::Node] # # @api private - # alias_method :dup_node, :dup_input # Return children @@ -56,7 +53,6 @@ module Mutant # @return [Array] # # @api private - # def children node.children end @@ -68,7 +64,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_child(index, mutator = Mutator, &block) block ||= TAUTOLOGY child = children.at(index) @@ -85,7 +80,6 @@ module Mutant # @return [undefined] # # @api private - # def delete_child(index) dup_children = children.dup dup_children.delete_at(index) @@ -100,7 +94,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_child_update(index, node) new_children = children.dup new_children[index] = node @@ -114,7 +107,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_type(*children) emit(Parser::AST::Node.new(node.type, children)) end @@ -124,7 +116,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_singletons emit_nil emit_self @@ -135,7 +126,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_self emit(N_SELF) end @@ -145,7 +135,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_nil emit(N_NIL) unless asgn_left? end @@ -157,7 +146,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_values(values) values.each do |value| emit_type(value) @@ -173,7 +161,6 @@ module Mutant # otherwise # # @api private - # def parent_node parent.node if parent end @@ -187,7 +174,6 @@ module Mutant # otherwise # # @api private - # def parent_type parent_node.type if parent_node end @@ -197,7 +183,6 @@ module Mutant # @return [Boolean] # # @api private - # def asgn_left? AST::Types::OP_ASSIGN.include?(parent_type) && parent.node.children.first.equal?(node) end @@ -209,7 +194,6 @@ module Mutant # @return [Enumerable] # # @api private - # def children_indices(range) range_end = range.end last_index = range_end >= 0 ? range_end : children.length + range_end diff --git a/lib/mutant/mutator/node/and_asgn.rb b/lib/mutant/mutator/node/and_asgn.rb index ac827364..9f6f3877 100644 --- a/lib/mutant/mutator/node/and_asgn.rb +++ b/lib/mutant/mutator/node/and_asgn.rb @@ -16,7 +16,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit_left_mutations do |node| diff --git a/lib/mutant/mutator/node/argument.rb b/lib/mutant/mutator/node/argument.rb index 66c7ae6c..da4cbd9f 100644 --- a/lib/mutant/mutator/node/argument.rb +++ b/lib/mutant/mutator/node/argument.rb @@ -17,7 +17,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_name_mutation end @@ -27,7 +26,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_name_mutation return if skip? Mutator::Util::Symbol.each(name, self) do |name| @@ -40,7 +38,6 @@ module Mutant # @return [Boolean] # # @api private - # def skip? name.to_s.start_with?(UNDERSCORE) end @@ -59,7 +56,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_name_mutation emit_required_mutation @@ -71,7 +67,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_required_mutation emit(s(:arg, name)) end diff --git a/lib/mutant/mutator/node/arguments.rb b/lib/mutant/mutator/node/arguments.rb index bef9f322..a25ef802 100644 --- a/lib/mutant/mutator/node/arguments.rb +++ b/lib/mutant/mutator/node/arguments.rb @@ -13,7 +13,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_argument_presence emit_argument_mutations @@ -25,7 +24,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_argument_presence emit_type Mutator::Util::Array::Presence.each(children, self) do |children| @@ -38,7 +36,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_argument_mutations children.each_with_index do |child, index| Mutator.each(child) do |mutant| @@ -55,7 +52,6 @@ module Mutant # @return [Boolean] # # @api private - # def invalid_argument_replacement?(mutant, index) original = children.fetch(index) @@ -69,7 +65,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_mlhs_expansion mlhs_childs_with_index.each do |child, index| dup_children = children.dup @@ -84,7 +79,6 @@ module Mutant # @return [Enumerable] # # @api private - # def mlhs_childs_with_index children.each_with_index.select do |child, _index| n_mlhs?(child) diff --git a/lib/mutant/mutator/node/begin.rb b/lib/mutant/mutator/node/begin.rb index 40f0da71..9ca7e2c5 100644 --- a/lib/mutant/mutator/node/begin.rb +++ b/lib/mutant/mutator/node/begin.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch Util::Array.each(children, self, &method(:emit_child_subset)) children.each_with_index do |child, index| @@ -30,7 +29,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_child_subset(children) return if children.length < 2 emit_type(*children) diff --git a/lib/mutant/mutator/node/binary.rb b/lib/mutant/mutator/node/binary.rb index 6b20228d..98a64844 100644 --- a/lib/mutant/mutator/node/binary.rb +++ b/lib/mutant/mutator/node/binary.rb @@ -20,7 +20,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit(left) @@ -36,7 +35,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_operator emit(s(INVERSE.fetch(node.type), left, right)) end @@ -46,7 +44,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_operands emit(s(node.type, n_not(left), right)) emit(n_not(node)) diff --git a/lib/mutant/mutator/node/block.rb b/lib/mutant/mutator/node/block.rb index 40ea18b9..286489d0 100644 --- a/lib/mutant/mutator/node/block.rb +++ b/lib/mutant/mutator/node/block.rb @@ -15,7 +15,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit(send) @@ -30,7 +29,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_body emit_body(nil) emit_body(N_RAISE) diff --git a/lib/mutant/mutator/node/break.rb b/lib/mutant/mutator/node/break.rb index 69255b86..b7254fbe 100644 --- a/lib/mutant/mutator/node/break.rb +++ b/lib/mutant/mutator/node/break.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch super emit_singletons diff --git a/lib/mutant/mutator/node/case.rb b/lib/mutant/mutator/node/case.rb index 80996e91..4b535326 100644 --- a/lib/mutant/mutator/node/case.rb +++ b/lib/mutant/mutator/node/case.rb @@ -16,7 +16,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit_condition_mutations if condition @@ -29,7 +28,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_when_mutations indices = children.each_index.drop(1).take(children.length - 2) one = indices.one? @@ -44,7 +42,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_else_mutations else_branch = children.last else_index = children.length - 1 diff --git a/lib/mutant/mutator/node/conditional_loop.rb b/lib/mutant/mutator/node/conditional_loop.rb index 9c717af4..7c6cd093 100644 --- a/lib/mutant/mutator/node/conditional_loop.rb +++ b/lib/mutant/mutator/node/conditional_loop.rb @@ -16,7 +16,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit_condition_mutations diff --git a/lib/mutant/mutator/node/const.rb b/lib/mutant/mutator/node/const.rb index 476483b9..23194fd1 100644 --- a/lib/mutant/mutator/node/const.rb +++ b/lib/mutant/mutator/node/const.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons unless parent_node && n_const?(parent_node) emit_type(nil, *children.drop(1)) diff --git a/lib/mutant/mutator/node/define.rb b/lib/mutant/mutator/node/define.rb index 26985a16..e1ba2dae 100644 --- a/lib/mutant/mutator/node/define.rb +++ b/lib/mutant/mutator/node/define.rb @@ -11,7 +11,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_arguments_mutations emit_body(N_RAISE) diff --git a/lib/mutant/mutator/node/defined.rb b/lib/mutant/mutator/node/defined.rb index 0bdc2c42..463e1373 100644 --- a/lib/mutant/mutator/node/defined.rb +++ b/lib/mutant/mutator/node/defined.rb @@ -15,7 +15,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_expression_mutations do |node| !n_self?(node) diff --git a/lib/mutant/mutator/node/dstr.rb b/lib/mutant/mutator/node/dstr.rb index f31482e6..e97b2014 100644 --- a/lib/mutant/mutator/node/dstr.rb +++ b/lib/mutant/mutator/node/dstr.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch super emit_singletons diff --git a/lib/mutant/mutator/node/dsym.rb b/lib/mutant/mutator/node/dsym.rb index d8bd54cd..85d80cc4 100644 --- a/lib/mutant/mutator/node/dsym.rb +++ b/lib/mutant/mutator/node/dsym.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch super emit_singletons diff --git a/lib/mutant/mutator/node/generic.rb b/lib/mutant/mutator/node/generic.rb index 5f8de327..1be2c910 100644 --- a/lib/mutant/mutator/node/generic.rb +++ b/lib/mutant/mutator/node/generic.rb @@ -23,7 +23,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch children.each_with_index do |child, index| mutate_child(index) if child.instance_of?(Parser::AST::Node) diff --git a/lib/mutant/mutator/node/if.rb b/lib/mutant/mutator/node/if.rb index 7130e877..a7528c8b 100644 --- a/lib/mutant/mutator/node/if.rb +++ b/lib/mutant/mutator/node/if.rb @@ -15,7 +15,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons mutate_condition @@ -28,7 +27,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_condition emit_condition_mutations do |node| !n_self?(node) @@ -43,7 +41,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_if_branch emit_type(condition, else_branch, nil) if else_branch return unless if_branch @@ -57,7 +54,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_else_branch return unless else_branch emit(else_branch) diff --git a/lib/mutant/mutator/node/kwbegin.rb b/lib/mutant/mutator/node/kwbegin.rb index 87cdbde0..78ea3c55 100644 --- a/lib/mutant/mutator/node/kwbegin.rb +++ b/lib/mutant/mutator/node/kwbegin.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch super emit_singletons diff --git a/lib/mutant/mutator/node/literal/array.rb b/lib/mutant/mutator/node/literal/array.rb index 0ccc7da8..4bb63869 100644 --- a/lib/mutant/mutator/node/literal/array.rb +++ b/lib/mutant/mutator/node/literal/array.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit_type @@ -28,7 +27,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_body children.each_index do |index| dup_children = children.dup diff --git a/lib/mutant/mutator/node/literal/boolean.rb b/lib/mutant/mutator/node/literal/boolean.rb index 4400f3d4..2dad21ea 100644 --- a/lib/mutant/mutator/node/literal/boolean.rb +++ b/lib/mutant/mutator/node/literal/boolean.rb @@ -19,7 +19,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_nil emit(s(MAP.fetch(node.type))) diff --git a/lib/mutant/mutator/node/literal/fixnum.rb b/lib/mutant/mutator/node/literal/fixnum.rb index 387bc1b5..9c638d8a 100644 --- a/lib/mutant/mutator/node/literal/fixnum.rb +++ b/lib/mutant/mutator/node/literal/fixnum.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit_values(values) @@ -25,7 +24,6 @@ module Mutant # @return [Array] # # @api private - # def values [0, 1, -value, value + 1, value - 1] end @@ -35,7 +33,6 @@ module Mutant # @return [Object] # # @api private - # def value children.first end diff --git a/lib/mutant/mutator/node/literal/float.rb b/lib/mutant/mutator/node/literal/float.rb index 1ebc34ac..502a798e 100644 --- a/lib/mutant/mutator/node/literal/float.rb +++ b/lib/mutant/mutator/node/literal/float.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit_values(values) @@ -32,7 +31,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_special_cases SPECIAL.each(&method(:emit)) end @@ -42,7 +40,6 @@ module Mutant # @return [Array] # # @api private - # def values original = children.first # Work around a bug in RBX/MRI or JRUBY: diff --git a/lib/mutant/mutator/node/literal/hash.rb b/lib/mutant/mutator/node/literal/hash.rb index 51c71cfa..6e397a73 100644 --- a/lib/mutant/mutator/node/literal/hash.rb +++ b/lib/mutant/mutator/node/literal/hash.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit_type @@ -26,7 +25,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_body children.each_index do |index| mutate_child(index) @@ -50,7 +48,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_key_mutations emit_value_mutations diff --git a/lib/mutant/mutator/node/literal/nil.rb b/lib/mutant/mutator/node/literal/nil.rb index a47ddb46..78fa6c03 100644 --- a/lib/mutant/mutator/node/literal/nil.rb +++ b/lib/mutant/mutator/node/literal/nil.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch end diff --git a/lib/mutant/mutator/node/literal/range.rb b/lib/mutant/mutator/node/literal/range.rb index 245d3a60..551e9d42 100644 --- a/lib/mutant/mutator/node/literal/range.rb +++ b/lib/mutant/mutator/node/literal/range.rb @@ -22,7 +22,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit_inverse @@ -35,7 +34,6 @@ module Mutant # @return [Parser::AST::Node] # # @api private - # def emit_inverse emit(s(MAP.fetch(node.type), *children)) end @@ -45,7 +43,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_upper_bound_mutations emit__end_mutations emit_type(N_NAN, _end) @@ -56,7 +53,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_lower_bound_mutations emit_start_mutations emit_type(start, N_INFINITY) diff --git a/lib/mutant/mutator/node/literal/regex.rb b/lib/mutant/mutator/node/literal/regex.rb index 09073c69..f78a1657 100644 --- a/lib/mutant/mutator/node/literal/regex.rb +++ b/lib/mutant/mutator/node/literal/regex.rb @@ -17,7 +17,6 @@ module Mutant # @return [Parser::AST::Node] # # @api private - # def options children.last end @@ -27,7 +26,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons unless parent_node && n_match_current_line?(parent_node) children.each_with_index do |child, index| diff --git a/lib/mutant/mutator/node/literal/string.rb b/lib/mutant/mutator/node/literal/string.rb index d710fe41..acb5b854 100644 --- a/lib/mutant/mutator/node/literal/string.rb +++ b/lib/mutant/mutator/node/literal/string.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons end diff --git a/lib/mutant/mutator/node/literal/symbol.rb b/lib/mutant/mutator/node/literal/symbol.rb index e139b562..a925443e 100644 --- a/lib/mutant/mutator/node/literal/symbol.rb +++ b/lib/mutant/mutator/node/literal/symbol.rb @@ -18,7 +18,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons Mutator::Util::Symbol.each(value, self) do |value| diff --git a/lib/mutant/mutator/node/masgn.rb b/lib/mutant/mutator/node/masgn.rb index c74f14fe..72d94c22 100644 --- a/lib/mutant/mutator/node/masgn.rb +++ b/lib/mutant/mutator/node/masgn.rb @@ -16,7 +16,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons end diff --git a/lib/mutant/mutator/node/match_current_line.rb b/lib/mutant/mutator/node/match_current_line.rb index 6e4a7a8f..f9e9ee4c 100644 --- a/lib/mutant/mutator/node/match_current_line.rb +++ b/lib/mutant/mutator/node/match_current_line.rb @@ -15,7 +15,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit_regexp_mutations diff --git a/lib/mutant/mutator/node/mlhs.rb b/lib/mutant/mutator/node/mlhs.rb index 08339a44..204cd38c 100644 --- a/lib/mutant/mutator/node/mlhs.rb +++ b/lib/mutant/mutator/node/mlhs.rb @@ -13,7 +13,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch children.each_index do |index| mutate_child(index) diff --git a/lib/mutant/mutator/node/named_value/access.rb b/lib/mutant/mutator/node/named_value/access.rb index 74af1f75..c4f96b99 100644 --- a/lib/mutant/mutator/node/named_value/access.rb +++ b/lib/mutant/mutator/node/named_value/access.rb @@ -15,7 +15,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons end diff --git a/lib/mutant/mutator/node/named_value/constant_assignment.rb b/lib/mutant/mutator/node/named_value/constant_assignment.rb index 00a63ea7..e4ab57ff 100644 --- a/lib/mutant/mutator/node/named_value/constant_assignment.rb +++ b/lib/mutant/mutator/node/named_value/constant_assignment.rb @@ -17,7 +17,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch mutate_name emit_value_mutations if value @@ -28,7 +27,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_name Mutator::Util::Symbol.each(name, self) do |name| emit_name(name.upcase) diff --git a/lib/mutant/mutator/node/named_value/variable_assignment.rb b/lib/mutant/mutator/node/named_value/variable_assignment.rb index 406bad04..b3d00426 100644 --- a/lib/mutant/mutator/node/named_value/variable_assignment.rb +++ b/lib/mutant/mutator/node/named_value/variable_assignment.rb @@ -28,7 +28,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons mutate_name @@ -40,7 +39,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_name prefix, regexp = MAP.fetch(node.type) stripped = name.to_s.sub(regexp, EMPTY_STRING) diff --git a/lib/mutant/mutator/node/next.rb b/lib/mutant/mutator/node/next.rb index bbc25561..2d918e77 100644 --- a/lib/mutant/mutator/node/next.rb +++ b/lib/mutant/mutator/node/next.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch super emit_singletons diff --git a/lib/mutant/mutator/node/noop.rb b/lib/mutant/mutator/node/noop.rb index 5f6178f7..3bf15952 100644 --- a/lib/mutant/mutator/node/noop.rb +++ b/lib/mutant/mutator/node/noop.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch # noop end diff --git a/lib/mutant/mutator/node/nthref.rb b/lib/mutant/mutator/node/nthref.rb index 5330b010..a4780c9f 100644 --- a/lib/mutant/mutator/node/nthref.rb +++ b/lib/mutant/mutator/node/nthref.rb @@ -15,7 +15,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch unless number.equal?(1) emit_number(number - 1) diff --git a/lib/mutant/mutator/node/op_asgn.rb b/lib/mutant/mutator/node/op_asgn.rb index 3245099d..c7a7f379 100644 --- a/lib/mutant/mutator/node/op_asgn.rb +++ b/lib/mutant/mutator/node/op_asgn.rb @@ -16,7 +16,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit_left_mutations do |node| diff --git a/lib/mutant/mutator/node/or_asgn.rb b/lib/mutant/mutator/node/or_asgn.rb index ee1350f7..64af5e51 100644 --- a/lib/mutant/mutator/node/or_asgn.rb +++ b/lib/mutant/mutator/node/or_asgn.rb @@ -16,7 +16,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit_right_mutations diff --git a/lib/mutant/mutator/node/resbody.rb b/lib/mutant/mutator/node/resbody.rb index 811761d0..d40263a0 100644 --- a/lib/mutant/mutator/node/resbody.rb +++ b/lib/mutant/mutator/node/resbody.rb @@ -15,7 +15,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_assignment(nil) emit_body_mutations if body @@ -27,7 +26,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_captures return unless captures Util::Array::Element.each(captures.children, self) do |matchers| diff --git a/lib/mutant/mutator/node/rescue.rb b/lib/mutant/mutator/node/rescue.rb index fccc441a..e551bc27 100644 --- a/lib/mutant/mutator/node/rescue.rb +++ b/lib/mutant/mutator/node/rescue.rb @@ -17,7 +17,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch mutate_body mutate_rescue_bodies @@ -31,7 +30,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_rescue_bodies children_indices(RESCUE_INDICES).each do |index| rescue_body = children.at(index) @@ -49,7 +47,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_concat(child) if body emit(s(:begin, body, child)) @@ -63,7 +60,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_body return unless body emit_body_mutations @@ -75,7 +71,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_else_body return unless else_body emit_else_body_mutations diff --git a/lib/mutant/mutator/node/return.rb b/lib/mutant/mutator/node/return.rb index d57ceeba..3d1bb2c5 100644 --- a/lib/mutant/mutator/node/return.rb +++ b/lib/mutant/mutator/node/return.rb @@ -15,7 +15,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons return unless value diff --git a/lib/mutant/mutator/node/send.rb b/lib/mutant/mutator/node/send.rb index 011ff635..3533fe8d 100644 --- a/lib/mutant/mutator/node/send.rb +++ b/lib/mutant/mutator/node/send.rb @@ -40,7 +40,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons if meta.index_assignment? @@ -55,7 +54,6 @@ module Mutant # @return [undefined] # # @api private - # def non_index_dispatch if meta.binary_method_operator? run(Binary) @@ -69,6 +67,8 @@ module Mutant # Return AST metadata for node # # @return [AST::Meta::Send] + # + # @api private def meta AST::Meta::Send.new(node) end @@ -79,7 +79,6 @@ module Mutant # @return [Enumerable] # # @api private - # alias_method :arguments, :remaining_children # Perform normal, non special case dispatch @@ -87,7 +86,6 @@ module Mutant # @return [undefined] # # @api private - # def normal_dispatch emit_naked_receiver emit_selector_replacement @@ -101,7 +99,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_selector_replacement SELECTOR_REPLACEMENTS.fetch(selector, EMPTY_ARRAY).each do |replacement| emit_selector(replacement) @@ -113,7 +110,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_naked_receiver emit(receiver) if receiver && !NOT_ASSIGNABLE.include?(receiver.type) end @@ -123,7 +119,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_arguments emit_type(receiver, selector) remaining_children_with_index.each do |_node, index| @@ -137,7 +132,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_argument_propagation node = arguments.first emit(node) if arguments.one? && !NOT_STANDALONE.include?(node.type) @@ -148,7 +142,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_receiver return unless receiver emit_implicit_self @@ -162,7 +155,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_implicit_self emit_receiver(nil) if n_self?(receiver) && !( KEYWORDS.include?(selector) || diff --git a/lib/mutant/mutator/node/send/attribute_assignment.rb b/lib/mutant/mutator/node/send/attribute_assignment.rb index bd1577f5..fa025c44 100644 --- a/lib/mutant/mutator/node/send/attribute_assignment.rb +++ b/lib/mutant/mutator/node/send/attribute_assignment.rb @@ -12,7 +12,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch normal_dispatch emit_attribute_read @@ -23,7 +22,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_arguments remaining_children_indices.each do |index| mutate_child(index) @@ -35,7 +33,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_attribute_read emit_type(receiver, selector.to_s[0..-2].to_sym) end diff --git a/lib/mutant/mutator/node/send/binary.rb b/lib/mutant/mutator/node/send/binary.rb index 5cc52923..5778145a 100644 --- a/lib/mutant/mutator/node/send/binary.rb +++ b/lib/mutant/mutator/node/send/binary.rb @@ -15,7 +15,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit(left) emit_left_mutations diff --git a/lib/mutant/mutator/node/send/index.rb b/lib/mutant/mutator/node/send/index.rb index 6424b032..9454e8cc 100644 --- a/lib/mutant/mutator/node/send/index.rb +++ b/lib/mutant/mutator/node/send/index.rb @@ -19,7 +19,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_naked_receiver emit_value_mutations @@ -33,7 +32,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_indices children_indices(INDEX_RANGE).each do |index| delete_child(index) @@ -46,7 +44,6 @@ module Mutant # @return [undefined] # # @api private - # def emit_index_read emit_type(receiver, :[], *children[INDEX_RANGE]) end diff --git a/lib/mutant/mutator/node/splat.rb b/lib/mutant/mutator/node/splat.rb index cb7511bf..3efb005f 100644 --- a/lib/mutant/mutator/node/splat.rb +++ b/lib/mutant/mutator/node/splat.rb @@ -15,7 +15,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit_expression_mutations diff --git a/lib/mutant/mutator/node/super.rb b/lib/mutant/mutator/node/super.rb index 57b14915..d03e0967 100644 --- a/lib/mutant/mutator/node/super.rb +++ b/lib/mutant/mutator/node/super.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons emit(N_ZSUPER) diff --git a/lib/mutant/mutator/node/when.rb b/lib/mutant/mutator/node/when.rb index bec34ea8..c45bb872 100644 --- a/lib/mutant/mutator/node/when.rb +++ b/lib/mutant/mutator/node/when.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch if body mutate_body @@ -29,7 +28,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_conditions conditions = children.length - 1 children[0..-2].each_index do |index| @@ -43,7 +41,6 @@ module Mutant # @return [undefined] # # @api private - # def mutate_body mutate_child(body_index) end @@ -57,7 +54,6 @@ module Mutant # otherwise # # @api private - # def body children[body_index] end @@ -67,7 +63,6 @@ module Mutant # @return [Fixnum] # # @api private - # def body_index children.length - 1 end diff --git a/lib/mutant/mutator/node/yield.rb b/lib/mutant/mutator/node/yield.rb index 377a6773..a3ae3c4d 100644 --- a/lib/mutant/mutator/node/yield.rb +++ b/lib/mutant/mutator/node/yield.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch super emit_singletons diff --git a/lib/mutant/mutator/node/zsuper.rb b/lib/mutant/mutator/node/zsuper.rb index acd90d9b..658b737b 100644 --- a/lib/mutant/mutator/node/zsuper.rb +++ b/lib/mutant/mutator/node/zsuper.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit_singletons end diff --git a/lib/mutant/mutator/registry.rb b/lib/mutant/mutator/registry.rb index a1d8391a..ceab37fe 100644 --- a/lib/mutant/mutator/registry.rb +++ b/lib/mutant/mutator/registry.rb @@ -8,7 +8,6 @@ module Mutant # @return [undefined] # # @api private - # def initialize @registry = {} end @@ -21,10 +20,9 @@ module Mutant # @param [Symbol] type # @param [Class:Mutator] mutator # - # @api private - # # @return [self] # + # @api private def register(type, mutator) fail RegistryError, "Invalid type registration: #{type}" unless AST::Types::ALL.include?(type) fail RegistryError, "Duplicate type registration: #{type}" if @registry.key?(type) @@ -42,7 +40,6 @@ module Mutant # raises argument error when mutator class cannot be found # # @api private - # def lookup(node) type = node.type @registry.fetch(type) do diff --git a/lib/mutant/mutator/util.rb b/lib/mutant/mutator/util.rb index 9e098348..992154ae 100644 --- a/lib/mutant/mutator/util.rb +++ b/lib/mutant/mutator/util.rb @@ -15,7 +15,6 @@ module Mutant # otherwise # # @api private - # def self.each(object, parent, &block) return to_enum(__method__, object, parent) unless block_given? @@ -33,7 +32,6 @@ module Mutant # @return [Boolean] # # @api private - # def new?(generated) !input.eql?(generated) end diff --git a/lib/mutant/mutator/util/array.rb b/lib/mutant/mutator/util/array.rb index 508e985a..1e2b3bb6 100644 --- a/lib/mutant/mutator/util/array.rb +++ b/lib/mutant/mutator/util/array.rb @@ -15,7 +15,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch input.each_index do |index| dup = dup_input @@ -36,7 +35,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch input.each_with_index do |element, index| Mutator.each(element).each do |mutation| @@ -56,7 +54,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch run(Element) run(Presence) diff --git a/lib/mutant/mutator/util/symbol.rb b/lib/mutant/mutator/util/symbol.rb index f58332a9..6253466d 100644 --- a/lib/mutant/mutator/util/symbol.rb +++ b/lib/mutant/mutator/util/symbol.rb @@ -14,7 +14,6 @@ module Mutant # @return [undefined] # # @api private - # def dispatch emit((input.to_s + POSTFIX).to_sym) end diff --git a/lib/mutant/parallel.rb b/lib/mutant/parallel.rb index 6d370b92..c8230a59 100644 --- a/lib/mutant/parallel.rb +++ b/lib/mutant/parallel.rb @@ -11,7 +11,6 @@ module Mutant # @return [Object] # # @api private - # def status binding.call(__method__) end @@ -21,7 +20,6 @@ module Mutant # @return [self] # # @api private - # def stop binding.call(__method__) self @@ -33,7 +31,6 @@ module Mutant # @return [Driver] # # @api private - # def self.async(config) Driver.new(config.env.new_mailbox.bind(Master.call(config))) end @@ -49,7 +46,6 @@ module Mutant # @return [self] # # @api private - # abstract_method :result # Return status @@ -57,7 +53,6 @@ module Mutant # @return [Object] # # @api private - # abstract_method :status # Test if processing should stop @@ -65,7 +60,6 @@ module Mutant # @return [Boolean] # # @api private - # abstract_method :stop? end # Sink diff --git a/lib/mutant/parallel/master.rb b/lib/mutant/parallel/master.rb index c217b653..8f55e844 100644 --- a/lib/mutant/parallel/master.rb +++ b/lib/mutant/parallel/master.rb @@ -13,7 +13,6 @@ module Mutant # @return [Actor::Sender] # # @api private - # def self.call(config) config.env.spawn do |mailbox| new(config, mailbox).__send__(:run) @@ -25,7 +24,6 @@ module Mutant # @return [undefined] # # @api private - # def initialize(*) super @@ -39,10 +37,9 @@ module Mutant # Run work loop # - # @api private - # # rubocop:disable MethodLength # + # @api private def run config.jobs.times do @workers += 1 @@ -72,7 +69,6 @@ module Mutant # @return [undefined] # # @api private - # def handle(message) type, payload = message.type, message.payload method = MAP.fetch(type) do @@ -86,7 +82,6 @@ module Mutant # @return [undefined] # # @api private - # def receive_loop handle(mailbox.receiver.call) until @workers.zero? && @stop end @@ -98,7 +93,6 @@ module Mutant # @return [undefined] # # @api private - # def handle_status(sender) status = Status.new( payload: sink.status, @@ -115,7 +109,6 @@ module Mutant # @return [undefined] # # @api private - # def handle_result(job_result) @active_jobs.delete(job_result.job) sink.result(job_result.payload) @@ -128,7 +121,6 @@ module Mutant # @return [undefined] # # @api private - # def handle_stop(sender) @stop = true receive_loop @@ -142,7 +134,6 @@ module Mutant # @return [undefined] # # @api private - # def handle_ready(sender) if stop_work? stop_worker(sender) @@ -159,6 +150,7 @@ module Mutant # # @return [nil] # + # @api private def next_job Job.new( index: @index, @@ -176,7 +168,6 @@ module Mutant # @return [undefined] # # @api private - # def stop_worker(sender) @workers -= 1 sender.call(Actor::Message.new(:stop)) @@ -187,7 +178,6 @@ module Mutant # @return [Boolean] # # @api private - # def stop_work? @stop || !source.next? || sink.stop? end @@ -197,7 +187,6 @@ module Mutant # @return [Source] # # @api private - # def source config.source end @@ -207,7 +196,6 @@ module Mutant # @return [Sink] # # @api private - # def sink config.sink end diff --git a/lib/mutant/parallel/source.rb b/lib/mutant/parallel/source.rb index 76cc6f82..1df9573c 100644 --- a/lib/mutant/parallel/source.rb +++ b/lib/mutant/parallel/source.rb @@ -14,7 +14,6 @@ module Mutant # when no next job is available # # @api private - # abstract_method :next # Test if next job is available @@ -22,7 +21,6 @@ module Mutant # @return [Boolean] # # @api private - # abstract_method :next? # Job source backed by a finite array @@ -34,7 +32,6 @@ module Mutant # @return [undefined] # # @api private - # def initialize(*) super @@ -46,7 +43,6 @@ module Mutant # @return [Boolean] # # @api private - # def next? @next_index < jobs.length end @@ -59,7 +55,6 @@ module Mutant # when no next job is available # # @api private - # def next fail NoJobError unless next? jobs.fetch(@next_index).tap do diff --git a/lib/mutant/parallel/worker.rb b/lib/mutant/parallel/worker.rb index fbd29bbc..82697599 100644 --- a/lib/mutant/parallel/worker.rb +++ b/lib/mutant/parallel/worker.rb @@ -11,7 +11,6 @@ module Mutant # @return [self] # # @api private - # def self.run(attributes) new(attributes).run self @@ -23,10 +22,9 @@ module Mutant # # @return [self] # - # @api private - # # rubocop:disable Lint/Loop # + # @api private def run begin parent.call(Actor::Message.new(:ready, mailbox.sender)) @@ -42,7 +40,6 @@ module Mutant # @return [Boolean] # # @api private - # def handle(message) type, payload = message.type, message.payload case message.type @@ -63,7 +60,6 @@ module Mutant # @return [undefined] # # @api private - # def handle_job(job) result = processor.call(job.payload) parent.call(Actor::Message.new(:result, JobResult.new(job: job, payload: result))) diff --git a/lib/mutant/reporter.rb b/lib/mutant/reporter.rb index ebc00cf5..80ffe87e 100644 --- a/lib/mutant/reporter.rb +++ b/lib/mutant/reporter.rb @@ -10,7 +10,6 @@ module Mutant # @return [self] # # @api private - # abstract_method :warn # Report start @@ -20,7 +19,6 @@ module Mutant # @return [self] # # @api private - # abstract_method :start # Report collector state @@ -30,7 +28,6 @@ module Mutant # @return [self] # # @api private - # abstract_method :report # Report progress on object @@ -40,7 +37,6 @@ module Mutant # @return [self] # # @api private - # abstract_method :progress end # Reporter diff --git a/lib/mutant/reporter/cli.rb b/lib/mutant/reporter/cli.rb index 45146502..113a6daf 100644 --- a/lib/mutant/reporter/cli.rb +++ b/lib/mutant/reporter/cli.rb @@ -11,7 +11,6 @@ module Mutant # @return [Reporter::CLI] # # @api private - # def self.build(output) tput = Tput.detect tty = output.respond_to?(:tty?) && output.tty? @@ -30,7 +29,6 @@ module Mutant # @return [self] # # @api private - # def start(env) write(format.start(env)) self @@ -43,7 +41,6 @@ module Mutant # @return [self] # # @api private - # def progress(status) write(format.progress(status)) self @@ -56,7 +53,6 @@ module Mutant # @return [Float] # # @api private - # def delay format.delay end @@ -68,7 +64,6 @@ module Mutant # @return [self] # # @api private - # def warn(message) output.puts(message) self @@ -81,7 +76,6 @@ module Mutant # @return [self] # # @api private - # def report(env) Printer::EnvResult.call(output, env) self @@ -96,7 +90,6 @@ module Mutant # @return [undefined] # # @api private - # def write(frame) output.write(frame) end diff --git a/lib/mutant/reporter/cli/format.rb b/lib/mutant/reporter/cli/format.rb index 51534da6..d1516ff7 100644 --- a/lib/mutant/reporter/cli/format.rb +++ b/lib/mutant/reporter/cli/format.rb @@ -12,7 +12,6 @@ module Mutant # @return [String] # # @api private - # abstract_method :start # Return progress representation @@ -22,7 +21,6 @@ module Mutant # @return [String] # # @api private - # abstract_method :progress # Return report delay in seconds @@ -30,7 +28,6 @@ module Mutant # @return [Float] # # @api private - # def delay self.class::REPORT_DELAY end @@ -44,7 +41,6 @@ module Mutant # @return [Boolean] # # @api private - # def tty? @tty end @@ -66,7 +62,6 @@ module Mutant # @return [String] # # @api private - # def format(printer, object) buffer = new_buffer printer.call(Output.new(tty, buffer), object) @@ -85,7 +80,6 @@ module Mutant # @return [String] # # @api private - # def start(env) format(Printer::Config, env.config) end @@ -95,7 +89,6 @@ module Mutant # @return [String] # # @api private - # def progress(status) format(Printer::StatusProgressive, status) end @@ -107,7 +100,6 @@ module Mutant # @return [StringIO] # # @api private - # def new_buffer StringIO.new end @@ -130,7 +122,6 @@ module Mutant # @return [String] # # @api private - # def start(_env) tput.prepare end @@ -142,7 +133,6 @@ module Mutant # @return [String] # # @api private - # def progress(status) format(Printer::Status, status) end @@ -154,7 +144,6 @@ module Mutant # @return [StringIO] # # @api private - # def new_buffer # For some reason this raises an Ernno::EACCESS errror: # diff --git a/lib/mutant/reporter/cli/printer.rb b/lib/mutant/reporter/cli/printer.rb index 87b745de..c91d0d99 100644 --- a/lib/mutant/reporter/cli/printer.rb +++ b/lib/mutant/reporter/cli/printer.rb @@ -16,7 +16,6 @@ module Mutant # @return [self] # # @api private - # abstract_method :run private @@ -26,7 +25,6 @@ module Mutant # @return [Color] # # @api private - # def status_color success? ? Color::GREEN : Color::RED end @@ -39,7 +37,6 @@ module Mutant # @return [undefined] # # @api private - # def visit_collection(printer, collection) collection.each do |object| visit(printer, object) @@ -54,7 +51,6 @@ module Mutant # @return [undefined] # # @api private - # def visit(printer, object) printer.call(output, object) end @@ -64,7 +60,6 @@ module Mutant # @return [undefined] # # @api private - # def info(string, *arguments) puts(format(string, *arguments)) end @@ -74,7 +69,6 @@ module Mutant # @return [undefined] # # @api private - # def status(string, *arguments) puts(colorize(status_color, format(string, *arguments))) end @@ -84,7 +78,6 @@ module Mutant # @return [undefined] # # @api private - # def puts(string) output.puts(string) end @@ -94,12 +87,11 @@ module Mutant # @param [Color] color # @param [String] message # - # @api private - # # @return [String] # if color is enabled # unmodified message otherwise # + # @api private def colorize(color, message) color = Color::NONE unless tty? color.format(message) @@ -110,7 +102,6 @@ module Mutant # @return [Boolean] # # @api private - # def tty? output.tty? end @@ -120,7 +111,6 @@ module Mutant # @return [Boolean] # # @api private - # alias_method :color?, :tty? end # Printer end # CLI diff --git a/lib/mutant/reporter/cli/printer/config.rb b/lib/mutant/reporter/cli/printer/config.rb index fbbbf5de..a8d8884b 100644 --- a/lib/mutant/reporter/cli/printer/config.rb +++ b/lib/mutant/reporter/cli/printer/config.rb @@ -11,10 +11,9 @@ module Mutant # # @return [undefined] # - # @api private - # # rubocop:disable AbcSize # + # @api private def run info 'Mutant configuration:' info 'Matcher: %s', object.matcher.inspect diff --git a/lib/mutant/reporter/cli/printer/env_progress.rb b/lib/mutant/reporter/cli/printer/env_progress.rb index b5128d96..395d4c25 100644 --- a/lib/mutant/reporter/cli/printer/env_progress.rb +++ b/lib/mutant/reporter/cli/printer/env_progress.rb @@ -20,10 +20,9 @@ module Mutant # # @return [undefined] # - # @api private - # # rubocop:disable AbcSize # + # @api private def run visit(Config, env.config) info 'Subjects: %s', amount_subjects @@ -44,7 +43,6 @@ module Mutant # @return [Float] # # @api private - # def coverage_percent coverage * 100 end @@ -54,7 +52,6 @@ module Mutant # @return [Float] # # @api private - # def overhead_percent (overhead / killtime) * 100 end diff --git a/lib/mutant/reporter/cli/printer/env_result.rb b/lib/mutant/reporter/cli/printer/env_result.rb index 34f778e1..462366d8 100644 --- a/lib/mutant/reporter/cli/printer/env_result.rb +++ b/lib/mutant/reporter/cli/printer/env_result.rb @@ -11,7 +11,6 @@ module Mutant # @return [undefined] # # @api private - # def run visit_collection(SubjectResult, failed_subject_results) visit(EnvProgress, object) diff --git a/lib/mutant/reporter/cli/printer/mutation_progress_result.rb b/lib/mutant/reporter/cli/printer/mutation_progress_result.rb index 799ada73..8a6047a6 100644 --- a/lib/mutant/reporter/cli/printer/mutation_progress_result.rb +++ b/lib/mutant/reporter/cli/printer/mutation_progress_result.rb @@ -12,7 +12,6 @@ module Mutant # @return [undefined] # # @api private - # def run char(success? ? SUCCESS : FAILURE) end @@ -26,7 +25,6 @@ module Mutant # @return [undefined] # # @api private - # def char(char) output.write(colorize(status_color, char)) end diff --git a/lib/mutant/reporter/cli/printer/mutation_result.rb b/lib/mutant/reporter/cli/printer/mutation_result.rb index f867fe96..a1d17707 100644 --- a/lib/mutant/reporter/cli/printer/mutation_result.rb +++ b/lib/mutant/reporter/cli/printer/mutation_result.rb @@ -51,7 +51,6 @@ module Mutant # @return [undefined] # # @api private - # def run puts(mutation.identification) print_details @@ -65,7 +64,6 @@ module Mutant # @return [undefined] # # @api private - # def print_details __send__(MAP.fetch(mutation.class)) end @@ -75,7 +73,6 @@ module Mutant # @return [String] # # @api private - # def evil_details diff = Diff.build(mutation.original_source, mutation.source) diff = color? ? diff.colorized_diff : diff.diff @@ -91,7 +88,6 @@ module Mutant # @return [undefined] # # @api private - # def print_no_diff_message info( NO_DIFF_MESSAGE, @@ -107,7 +103,6 @@ module Mutant # @return [String] # # @api private - # def noop_details info(NOOP_MESSAGE) visit_test_result @@ -118,7 +113,6 @@ module Mutant # @return [String] # # @api private - # def neutral_details info(NEUTRAL_MESSAGE, original_node.inspect, mutation.source) visit_test_result @@ -129,7 +123,6 @@ module Mutant # @return [undefined] # # @api private - # def visit_test_result visit(TestResult, test_result) end @@ -139,7 +132,6 @@ module Mutant # @return [Parser::AST::Node] # # @api private - # def original_node mutation.subject.node end diff --git a/lib/mutant/reporter/cli/printer/status.rb b/lib/mutant/reporter/cli/printer/status.rb index 7c505677..0cea4d1c 100644 --- a/lib/mutant/reporter/cli/printer/status.rb +++ b/lib/mutant/reporter/cli/printer/status.rb @@ -15,7 +15,6 @@ module Mutant # @return [undefined] # # @api private - # def run visit(EnvProgress, payload) job_status @@ -30,7 +29,6 @@ module Mutant # @return [undefined] # # @api private - # def job_status return if active_jobs.empty? info(ACTIVE_JOB_HEADER) @@ -44,7 +42,6 @@ module Mutant # @return [Array] # # @api private - # def active_subject_results active_subjects = active_jobs.map(&:payload).flat_map(&:subject) diff --git a/lib/mutant/reporter/cli/printer/status_progressive.rb b/lib/mutant/reporter/cli/printer/status_progressive.rb index 00787570..06058bc7 100644 --- a/lib/mutant/reporter/cli/printer/status_progressive.rb +++ b/lib/mutant/reporter/cli/printer/status_progressive.rb @@ -21,7 +21,6 @@ module Mutant # @return [undefined] # # @api private - # def run status( FORMAT, @@ -41,7 +40,6 @@ module Mutant # @return [Result::Env] # # @api private - # def object super.payload end diff --git a/lib/mutant/reporter/cli/printer/subject_progress.rb b/lib/mutant/reporter/cli/printer/subject_progress.rb index 2e30d3e9..8fe23776 100644 --- a/lib/mutant/reporter/cli/printer/subject_progress.rb +++ b/lib/mutant/reporter/cli/printer/subject_progress.rb @@ -23,7 +23,6 @@ module Mutant # @return [undefined] # # @api private - # def run puts("#{subject.identification} mutations: #{amount_mutations}") print_mutation_results @@ -39,7 +38,6 @@ module Mutant # @return [undefined] # # @api private - # def print_stats status( FORMAT, @@ -57,7 +55,6 @@ module Mutant # @return [undefined] # # @api private - # def print_tests tests.each do |test| puts "- #{test.identification}" @@ -69,7 +66,6 @@ module Mutant # @return [undefined] # # @api private - # def print_progress_bar_finish puts(nil) unless amount_mutation_results.zero? end @@ -79,7 +75,6 @@ module Mutant # @return [undefined] # # @api private - # def print_mutation_results visit_collection(MutationProgressResult, object.mutation_results) end diff --git a/lib/mutant/reporter/cli/printer/subject_result.rb b/lib/mutant/reporter/cli/printer/subject_result.rb index fcaf1317..b9fa51c4 100644 --- a/lib/mutant/reporter/cli/printer/subject_result.rb +++ b/lib/mutant/reporter/cli/printer/subject_result.rb @@ -12,7 +12,6 @@ module Mutant # @return [undefined] # # @api private - # def run status(subject.identification) tests.each do |test| diff --git a/lib/mutant/reporter/cli/printer/test_result.rb b/lib/mutant/reporter/cli/printer/test_result.rb index 19024e9d..3aa3907f 100644 --- a/lib/mutant/reporter/cli/printer/test_result.rb +++ b/lib/mutant/reporter/cli/printer/test_result.rb @@ -16,7 +16,6 @@ module Mutant # @return [undefined] # # @api private - # def run info(STATUS_FORMAT, tests.length, runtime) tests.each do |test| diff --git a/lib/mutant/reporter/cli/tput.rb b/lib/mutant/reporter/cli/tput.rb index 2ad251f5..15b509a3 100644 --- a/lib/mutant/reporter/cli/tput.rb +++ b/lib/mutant/reporter/cli/tput.rb @@ -14,6 +14,8 @@ module Mutant # # @return [nil] # otherwise + # + # @api private def self.detect reset = capture('tput reset') save = capture('tput sc') if reset @@ -33,6 +35,7 @@ module Mutant # @return [nil] # otherwise # + # @api private def self.capture(command) stdout, _stderr, exitstatus = Open3.capture3(command) stdout if exitstatus.success? diff --git a/lib/mutant/reporter/trace.rb b/lib/mutant/reporter/trace.rb index f1bb4973..5c74c3fb 100644 --- a/lib/mutant/reporter/trace.rb +++ b/lib/mutant/reporter/trace.rb @@ -9,7 +9,6 @@ module Mutant # @return [Trace] # # @api private - # def self.new super(Hash[anima.attribute_names.map { |name| [name, []] }]) end @@ -28,7 +27,6 @@ module Mutant # @return [Float] # # @api private - # def delay REPORT_DELAY end diff --git a/lib/mutant/require_highjack.rb b/lib/mutant/require_highjack.rb index 9f406371..eb072cb5 100644 --- a/lib/mutant/require_highjack.rb +++ b/lib/mutant/require_highjack.rb @@ -11,7 +11,6 @@ module Mutant # the original implementation on singleton # # @api private - # def self.call(target, callback) target.method(:require).tap do target.module_eval do diff --git a/lib/mutant/result.rb b/lib/mutant/result.rb index 2fef51e2..cf02aa84 100644 --- a/lib/mutant/result.rb +++ b/lib/mutant/result.rb @@ -10,7 +10,6 @@ module Mutant # @return [Rational] # # @api private - # def coverage return Rational(0) if amount_mutation_results.zero? @@ -24,7 +23,6 @@ module Mutant # @return [undefined] # # @api private - # def self.included(host) super @@ -47,7 +45,6 @@ module Mutant # @return [undefined] # # @api private - # def sum(name, collection) define_method(name) do public_send(collection).map(&name).reduce(0, :+) @@ -61,7 +58,6 @@ module Mutant # @return [Float] # # @api private - # def overhead runtime - killtime end @@ -73,7 +69,6 @@ module Mutant # @return [undefined] # # @api private - # def self.included(host) host.class_eval do include Adamantium, Anima::Update @@ -90,7 +85,6 @@ module Mutant # @return [Boolean] # # @api private - # def success? coverage.eql?(env.config.expected_coverage) end @@ -101,7 +95,6 @@ module Mutant # @return [Array] # # @api private - # def failed_subject_results subject_results.reject(&:success?) end @@ -116,7 +109,6 @@ module Mutant # @return [Fixnum] # # @api private - # def amount_mutations env.mutations.length end @@ -126,7 +118,6 @@ module Mutant # @return [Fixnum] # # @api private - # def amount_subjects env.subjects.length end @@ -155,7 +146,6 @@ module Mutant # @return [Boolean] # # @api private - # def success? alive_mutation_results.empty? end @@ -165,7 +155,6 @@ module Mutant # @return [Boolean] # # @api private - # def continue? mutation_results.all?(&:success?) end @@ -175,7 +164,6 @@ module Mutant # @return [Array] # # @api private - # def alive_mutation_results mutation_results.reject(&:success?) end @@ -186,7 +174,6 @@ module Mutant # @return [Fixnum] # # @api private - # def amount_mutation_results mutation_results.length end @@ -196,7 +183,6 @@ module Mutant # @return [Fixnum] # # @api private - # def amount_mutations subject.mutations.length end @@ -206,7 +192,6 @@ module Mutant # @return [Fixnum] # # @api private - # def amount_mutations_killed killed_mutation_results.length end @@ -216,7 +201,6 @@ module Mutant # @return [Fixnum] # # @api private - # def amount_mutations_alive alive_mutation_results.length end @@ -226,7 +210,6 @@ module Mutant # @return [Array] # # @api private - # def killed_mutation_results mutation_results.select(&:success?) end @@ -243,7 +226,6 @@ module Mutant # @return [Float] # # @api private - # def runtime test_result.runtime end @@ -255,7 +237,6 @@ module Mutant # @return [Boolean] # # @api private - # def success? mutation.class.success?(test_result) end diff --git a/lib/mutant/runner.rb b/lib/mutant/runner.rb index 6c82d151..c459b8e4 100644 --- a/lib/mutant/runner.rb +++ b/lib/mutant/runner.rb @@ -8,7 +8,6 @@ module Mutant # @return [undefined] # # @api private - # def initialize(*) super @@ -22,7 +21,6 @@ module Mutant # @return [Result::Env] # # @api private - # attr_reader :result private @@ -32,7 +30,6 @@ module Mutant # @return [undefined] # # @api private - # def run_mutation_analysis @result = run_driver(Parallel.async(mutation_test_config)) reporter.report(@result) @@ -46,7 +43,6 @@ module Mutant # the last returned status payload # # @api private - # def run_driver(driver) status = nil @@ -67,7 +63,6 @@ module Mutant # @return [Parallell::Config] # # @api private - # def mutation_test_config Parallel::Config.new( env: env.actor_env, @@ -83,7 +78,6 @@ module Mutant # @return [Reporter] # # @api private - # def reporter env.config.reporter end @@ -93,7 +87,6 @@ module Mutant # @return [Config] # # @api private - # def config env.config end diff --git a/lib/mutant/runner/sink.rb b/lib/mutant/runner/sink.rb index c9cec37c..1ef29ff8 100644 --- a/lib/mutant/runner/sink.rb +++ b/lib/mutant/runner/sink.rb @@ -9,7 +9,6 @@ module Mutant # @return [Object] # # @api private - # abstract_method :status # Test if computation should be stopped @@ -17,7 +16,6 @@ module Mutant # @return [Boolean] # # @api private - # abstract_method :stop? # Consume result @@ -27,7 +25,6 @@ module Mutant # @return [self] # # @api private - # abstract_method :result # Mutation result sink @@ -39,7 +36,6 @@ module Mutant # @return [undefined] # # @api private - # def initialize(*) super @start = Time.now @@ -57,7 +53,6 @@ module Mutant # @return [Status] # # @api private - # def status env_result end @@ -67,7 +62,6 @@ module Mutant # @return [Boolean] # # @api private - # def stop? env.config.fail_fast && !env_result.subject_results.all?(&:success?) end @@ -79,7 +73,6 @@ module Mutant # @return [self] # # @api private - # def result(mutation_result) mutation = mutation_result.mutation @@ -100,7 +93,6 @@ module Mutant # @return [Result::Env] # # @api private - # def env_result Result::Env.new( env: env, diff --git a/lib/mutant/selector.rb b/lib/mutant/selector.rb index 3bf0b4e8..aed09876 100644 --- a/lib/mutant/selector.rb +++ b/lib/mutant/selector.rb @@ -10,7 +10,6 @@ module Mutant # @return [Enumerable] # # @api private - # abstract_method :call end # Selector diff --git a/lib/mutant/selector/expression.rb b/lib/mutant/selector/expression.rb index 350b3910..66fbe841 100644 --- a/lib/mutant/selector/expression.rb +++ b/lib/mutant/selector/expression.rb @@ -11,7 +11,6 @@ module Mutant # @return [Enumerable] # # @api private - # def call(subject) subject.match_expressions.each do |match_expression| subject_tests = integration.all_tests.select do |test| diff --git a/lib/mutant/subject.rb b/lib/mutant/subject.rb index 4d898854..26013c92 100644 --- a/lib/mutant/subject.rb +++ b/lib/mutant/subject.rb @@ -10,7 +10,6 @@ module Mutant # @return [undefined] # # @api private - # def mutations mutations = [neutral_mutation] Mutator.each(node) do |mutant| @@ -25,7 +24,6 @@ module Mutant # @return [String] # # @api private - # def source_path context.source_path end @@ -35,7 +33,6 @@ module Mutant # @return [self] # # @api private - # def prepare self end @@ -45,7 +42,6 @@ module Mutant # @return [Range] # # @api private - # def source_lines expression = node.location.expression expression.line..expression.source_buffer.decompose_position(expression.end_pos).first @@ -57,7 +53,6 @@ module Mutant # @return [Fixnum] # # @api private - # def source_line source_lines.begin end @@ -67,7 +62,6 @@ module Mutant # @return [String] # # @api private - # def identification "#{expression.syntax}:#{source_path}:#{source_line}" end @@ -78,7 +72,6 @@ module Mutant # @return [String] # # @api private - # def source Unparser.unparse(wrap_node(node)) end @@ -89,7 +82,6 @@ module Mutant # @return [Expression] # # @api private - # abstract_method :expression # Return match expressions @@ -97,7 +89,6 @@ module Mutant # @return [Enumerable] # # @api private - # abstract_method :match_expressions private @@ -107,7 +98,6 @@ module Mutant # @return [Mutation::Neutral] # # @api private - # def neutral_mutation Mutation::Neutral.new(self, wrap_node(node)) end @@ -119,7 +109,6 @@ module Mutant # @return [Parser::AST::Node] # # @api private - # def wrap_node(node) node end diff --git a/lib/mutant/subject/method.rb b/lib/mutant/subject/method.rb index 7882f50e..1baac54a 100644 --- a/lib/mutant/subject/method.rb +++ b/lib/mutant/subject/method.rb @@ -8,7 +8,6 @@ module Mutant # @return [Boolean] # # @api private - # abstract_method :public? # Return method name @@ -16,7 +15,6 @@ module Mutant # @return [Expression] # # @api private - # def name node.children.fetch(self.class::NAME_INDEX) end @@ -26,7 +24,6 @@ module Mutant # @return [String] # # @api private - # def expression Expression::Method.new( scope_symbol: self.class::SYMBOL, @@ -41,7 +38,6 @@ module Mutant # @return [Array] # # @api private - # def match_expressions [expression].concat(context.match_expressions) end @@ -54,7 +50,6 @@ module Mutant # @return [Class, Module] # # @api private - # def scope context.scope end diff --git a/lib/mutant/subject/method/instance.rb b/lib/mutant/subject/method/instance.rb index cc2e0532..c99b2087 100644 --- a/lib/mutant/subject/method/instance.rb +++ b/lib/mutant/subject/method/instance.rb @@ -12,7 +12,6 @@ module Mutant # @return [Boolean] # # @api private - # def public? scope.public_method_defined?(name) end @@ -23,7 +22,6 @@ module Mutant # @return [self] # # @api private - # def prepare scope.__send__(:undef_method, name) self @@ -38,7 +36,6 @@ module Mutant # @return [self] # # @api private - # def prepare scope.__send__(:memoized_methods).instance_variable_get(:@memory).delete(name) super @@ -54,7 +51,6 @@ module Mutant # @return [Parser::AST::Node] # # @api private - # def wrap_node(mutant) s(:begin, mutant, s(:send, nil, :memoize, s(:args, s(:sym, name)))) end diff --git a/lib/mutant/subject/method/singleton.rb b/lib/mutant/subject/method/singleton.rb index 0850084f..a240c6ae 100644 --- a/lib/mutant/subject/method/singleton.rb +++ b/lib/mutant/subject/method/singleton.rb @@ -12,7 +12,6 @@ module Mutant # @return [Boolean] # # @api private - # def public? scope.singleton_class.public_method_defined?(name) end @@ -23,7 +22,6 @@ module Mutant # @return [self] # # @api private - # def prepare scope.singleton_class.__send__(:undef_method, name) self diff --git a/lib/mutant/test.rb b/lib/mutant/test.rb index 13319e60..31bc03e3 100644 --- a/lib/mutant/test.rb +++ b/lib/mutant/test.rb @@ -8,7 +8,6 @@ module Mutant # @return [String] # # @api private - # alias_method :identification, :id end # Test diff --git a/lib/mutant/warning_filter.rb b/lib/mutant/warning_filter.rb index bb7905db..7505f3bf 100644 --- a/lib/mutant/warning_filter.rb +++ b/lib/mutant/warning_filter.rb @@ -12,7 +12,6 @@ module Mutant # @return [undefined] # # @api private - # def initialize(target) @target = target @warnings = [] @@ -23,7 +22,6 @@ module Mutant # @return [Array] # # @api private - # attr_reader :warnings # Return target @@ -33,7 +31,6 @@ module Mutant # @return [undefined] # # @api private - # attr_reader :target protected :target @@ -44,7 +41,6 @@ module Mutant # @return [self] # # @api private - # def write(message) if WARNING_PATTERN =~ message warnings << message @@ -60,7 +56,6 @@ module Mutant # @return [Array] # # @api private - # def self.use original = $stderr $stderr = filter = new(original) diff --git a/lib/mutant/zombifier.rb b/lib/mutant/zombifier.rb index 9c3fc3fc..348345f1 100644 --- a/lib/mutant/zombifier.rb +++ b/lib/mutant/zombifier.rb @@ -22,13 +22,17 @@ module Mutant # @return [undefined] # # @api private - # def initialize(*) super @includes = %r{\A#{Regexp.union(includes)}(?:/.*)?\z} @zombified = Set.new end + # Call zombifier + # + # @return [self] + # + # @api private def self.call(*args) new(*args).__send__(:call) self @@ -41,7 +45,6 @@ module Mutant # @return [undefined] # # @api private - # def call @original = require_highjack.call(method(:require)) require(root_require) @@ -52,7 +55,6 @@ module Mutant # @param [String] # # @api private - # def include?(logical_name) !@zombified.include?(logical_name) && @includes =~ logical_name end @@ -64,7 +66,6 @@ module Mutant # @return [undefined] # # @api private - # def require(logical_name) logical_name = logical_name.to_s @original.call(logical_name) @@ -83,7 +84,6 @@ module Mutant # otherwise # # @api private - # def find(logical_name) file_name = "#{logical_name}.rb" @@ -104,7 +104,6 @@ module Mutant # @return [undefined] # # @api private - # def zombify(source_path) kernel.eval( Unparser.unparse(namespaced_node(source_path)), @@ -120,7 +119,6 @@ module Mutant # @return [Parser::AST::Node] # # @api private - # def namespaced_node(source_path) s(:module, s(:const, nil, namespace), Parser::CurrentRuby.parse(source_path.read)) end diff --git a/spec/support/corpus.rb b/spec/support/corpus.rb index 86980380..f9d0e7a0 100644 --- a/spec/support/corpus.rb +++ b/spec/support/corpus.rb @@ -31,6 +31,7 @@ module MutantSpec # # @raise [Exception] # + # @api private def verify_mutation_coverage checkout Dir.chdir(repo_path) do @@ -60,6 +61,7 @@ module MutantSpec # # rubocop:disable AbcSize # + # @api private def verify_mutation_generation checkout start = Time.now @@ -99,7 +101,6 @@ module MutantSpec # @return [self] # # @api private - # def checkout return self if noinstall? TMP.mkdir unless TMP.directory? @@ -126,7 +127,6 @@ module MutantSpec # @return [undefined] # # @api private - # def install_mutant return if noinstall? relative = ROOT.relative_path_from(repo_path) @@ -147,7 +147,6 @@ module MutantSpec # @return [Fixnum] # # @api private - # def parallel_processes if ENV['CI'] Mutant::Config::DEFAULT.jobs @@ -161,7 +160,6 @@ module MutantSpec # @return [Pathname] # # @api private - # def repo_path TMP.join(name) end @@ -171,7 +169,6 @@ module MutantSpec # @return [Boolean] # # @api private - # def noinstall? ENV.key?('NOINSTALL') end @@ -208,7 +205,6 @@ module MutantSpec # @param [Array] arguments # # @api private - # def system(arguments) return if Kernel.system(*arguments) if block_given? diff --git a/spec/support/rb_bug.rb b/spec/support/rb_bug.rb index bb646fa9..ed319199 100644 --- a/spec/support/rb_bug.rb +++ b/spec/support/rb_bug.rb @@ -10,7 +10,6 @@ module RbBug # @return [undefined] # # @api private - # def self.call rb_bug('%s', :string, 'test bug') end diff --git a/spec/support/rspec.rb b/spec/support/rspec.rb index a495f2de..cb756cbc 100644 --- a/spec/support/rspec.rb +++ b/spec/support/rspec.rb @@ -6,7 +6,6 @@ module Rspec # returns the value of block # # @api private - # def self.nest original_world, original_configuration = ::RSpec.instance_variable_get(:@world), From 8335cccafb5c75f745fa25fa06cc1aa9ad905517 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Fri, 3 Jul 2015 15:21:39 +0000 Subject: [PATCH 2/3] Fix YARD summary line * Reduce redunrant 'Return' prefix on summaries * Improve summary line to reflect the semantics of operation better --- lib/mutant/actor.rb | 4 +-- lib/mutant/actor/env.rb | 2 +- lib/mutant/actor/mailbox.rb | 4 +-- lib/mutant/ast/meta.rb | 2 +- lib/mutant/ast/named_children.rb | 2 +- lib/mutant/cache.rb | 2 +- lib/mutant/cli.rb | 2 +- lib/mutant/config.rb | 5 +++- lib/mutant/context.rb | 4 +-- lib/mutant/context/scope.rb | 14 +++++----- lib/mutant/diff.rb | 16 +++++------ lib/mutant/env/bootstrap.rb | 10 +++---- lib/mutant/expression.rb | 4 +-- lib/mutant/expression/method.rb | 6 ++-- lib/mutant/expression/methods.rb | 8 +++--- lib/mutant/expression/namespace.rb | 10 +++---- lib/mutant/expression/parser.rb | 2 +- lib/mutant/integration.rb | 10 +++---- lib/mutant/integration/rspec.rb | 8 +++--- lib/mutant/loader.rb | 2 +- lib/mutant/matcher/compiler.rb | 12 ++++---- lib/mutant/matcher/config.rb | 2 +- lib/mutant/matcher/method.rb | 20 ++++++------- lib/mutant/matcher/method/instance.rb | 4 +-- lib/mutant/matcher/methods.rb | 18 ++++++------ lib/mutant/meta/example.rb | 24 ++++++++-------- lib/mutant/meta/example/dsl.rb | 2 +- lib/mutant/mutation.rb | 12 ++++---- lib/mutant/mutator.rb | 4 +-- lib/mutant/mutator/node.rb | 12 ++++---- lib/mutant/mutator/node/arguments.rb | 2 +- lib/mutant/mutator/node/literal/fixnum.rb | 4 +-- lib/mutant/mutator/node/literal/float.rb | 2 +- lib/mutant/mutator/node/literal/range.rb | 2 +- lib/mutant/mutator/node/literal/regex.rb | 2 +- lib/mutant/mutator/node/send.rb | 4 +-- lib/mutant/mutator/node/when.rb | 4 +-- lib/mutant/parallel.rb | 4 +-- lib/mutant/parallel/master.rb | 6 ++-- lib/mutant/parallel/source.rb | 4 +-- lib/mutant/reporter/cli.rb | 2 +- lib/mutant/reporter/cli/format.rb | 14 +++++----- lib/mutant/reporter/cli/printer.rb | 2 +- .../reporter/cli/printer/env_progress.rb | 4 +-- .../reporter/cli/printer/mutation_result.rb | 6 ++-- lib/mutant/reporter/cli/printer/status.rb | 2 +- .../cli/printer/status_progressive.rb | 2 +- lib/mutant/reporter/cli/tput.rb | 2 +- lib/mutant/reporter/trace.rb | 4 +-- lib/mutant/result.rb | 28 +++++++++++-------- lib/mutant/runner.rb | 8 +++--- lib/mutant/runner/sink.rb | 6 ++-- lib/mutant/selector.rb | 2 +- lib/mutant/selector/expression.rb | 2 +- lib/mutant/subject.rb | 20 ++++++------- lib/mutant/subject/method.rb | 8 +++--- lib/mutant/subject/method/instance.rb | 2 +- lib/mutant/test.rb | 2 +- lib/mutant/version.rb | 2 +- lib/mutant/warning_filter.rb | 4 +-- lib/mutant/zombifier.rb | 2 +- spec/support/corpus.rb | 4 +-- 62 files changed, 198 insertions(+), 191 deletions(-) diff --git a/lib/mutant/actor.rb b/lib/mutant/actor.rb index 58cfdb62..f1a71c45 100644 --- a/lib/mutant/actor.rb +++ b/lib/mutant/actor.rb @@ -10,7 +10,7 @@ module Mutant Undefined = Class.new do INSPECT = 'Mutant::Actor::Undefined'.freeze - # Return object inspection + # Object inspection # # @return [String] # @@ -24,7 +24,7 @@ module Mutant class Message include Concord::Public.new(:type, :payload) - # Return new message + # New message # # @param [Symbol] type # @param [Object] payload diff --git a/lib/mutant/actor/env.rb b/lib/mutant/actor/env.rb index eaaecff7..404915f6 100644 --- a/lib/mutant/actor/env.rb +++ b/lib/mutant/actor/env.rb @@ -19,7 +19,7 @@ module Mutant mailbox.sender end - # Return new unbound mailbox + # New unbound mailbox # # @return [Mailbox] # diff --git a/lib/mutant/actor/mailbox.rb b/lib/mutant/actor/mailbox.rb index 40dea502..99add62a 100644 --- a/lib/mutant/actor/mailbox.rb +++ b/lib/mutant/actor/mailbox.rb @@ -4,7 +4,7 @@ module Mutant class Mailbox include Adamantium::Flat, Concord::Public.new(:receiver, :sender) - # Return new mailbox + # New mailbox # # @return [Mailbox] # @@ -20,7 +20,7 @@ module Mutant ) end - # Return binding for RPC to other actors + # Binding for RPC to other actors # # @param [Actor::Sender] other # diff --git a/lib/mutant/ast/meta.rb b/lib/mutant/ast/meta.rb index 8c28e3eb..f7701c7b 100644 --- a/lib/mutant/ast/meta.rb +++ b/lib/mutant/ast/meta.rb @@ -19,7 +19,7 @@ module Mutant INDEX_ASSIGNMENT_SELECTOR = :[]= ATTRIBUTE_ASSIGNMENT_SELECTOR_SUFFIX = '='.freeze - # Return arguments + # Arguments of mutated node # # @return [Enumerable] # diff --git a/lib/mutant/ast/named_children.rb b/lib/mutant/ast/named_children.rb index a94d0b30..dd6c75fa 100644 --- a/lib/mutant/ast/named_children.rb +++ b/lib/mutant/ast/named_children.rb @@ -23,7 +23,7 @@ module Mutant private - # Return children + # Mutated nodes children # # @return [Array] # @@ -65,7 +65,7 @@ module Mutant end memoize :nesting - # Return unqualified name of scope + # Unqualified name of scope # # @return [String] # @@ -74,7 +74,7 @@ module Mutant name_nesting.last end - # Return match expressions + # Match expressions for scope # # @return [Enumerable] # @@ -88,7 +88,7 @@ module Mutant end memoize :match_expressions - # Return scope wrapped by context + # Scope wrapped by context # # @return [::Module|::Class] # @@ -97,7 +97,7 @@ module Mutant private - # Return nesting of names of scope + # Nesting of names in scope # # @return [Array] # diff --git a/lib/mutant/diff.rb b/lib/mutant/diff.rb index 16cf848b..07daa388 100644 --- a/lib/mutant/diff.rb +++ b/lib/mutant/diff.rb @@ -7,7 +7,7 @@ module Mutant DELETION = '-'.freeze NEWLINE = "\n".freeze - # Return source diff + # Unified source diff between old and new # # @return [String] # if there is exactly one diff @@ -25,7 +25,7 @@ module Mutant end memoize :diff - # Return colorized source diff + # Colorized unified source diff between old and new # # @return [String] # if there is a diff @@ -40,7 +40,7 @@ module Mutant end memoize :colorized_diff - # Return new object + # Build new object from source strings # # @param [String] old # @param [String] new @@ -66,7 +66,7 @@ module Mutant private - # Return diffs + # Diffs between old and new # # @return [Array] # @@ -75,7 +75,7 @@ module Mutant ::Diff::LCS.diff(old, new) end - # Return hunks + # Raw diff-lcs hunks # # @return [Array] # @@ -86,7 +86,7 @@ module Mutant end end - # Return minimized hunks + # Minimized hunks # # @return [Array] # @@ -104,7 +104,7 @@ module Mutant end end - # Return max length + # Max length of source line in new and old # # @return [Fixnum] # @@ -113,7 +113,7 @@ module Mutant [old, new].map(&:length).max end - # Return colorized diff line + # Colorized a unified diff line # # @param [String] line # diff --git a/lib/mutant/env/bootstrap.rb b/lib/mutant/env/bootstrap.rb index 3cdfc175..d7b6ce27 100644 --- a/lib/mutant/env/bootstrap.rb +++ b/lib/mutant/env/bootstrap.rb @@ -8,14 +8,14 @@ module Mutant "Fix your lib to follow normal ruby semantics!\n" \ '{Module,Class}#name should return resolvable constant name as String or nil'.freeze - # Return scopes that are eligible for mnatching + # Scopes that are eligible for matching # # @return [Enumerable] # # @api private attr_reader :matchable_scopes - # Return new bootstrap env + # New bootstrap env # # @return [Env] # @@ -47,7 +47,7 @@ module Mutant self end - # Return environment after bootstraping + # Environment after bootstraping # # @return [Env] # @@ -70,7 +70,7 @@ module Mutant private - # Return scope name + # Scope name from scopeing object # # @param [Class, Module] scope # @@ -99,7 +99,7 @@ module Mutant @integration = config.integration.new(config).setup end - # Return matched subjects + # Matched subjects # # @return [Enumerable] # diff --git a/lib/mutant/expression.rb b/lib/mutant/expression.rb index f6e680d2..e2b95a28 100644 --- a/lib/mutant/expression.rb +++ b/lib/mutant/expression.rb @@ -10,14 +10,14 @@ module Mutant private_constant(*constants(false)) - # Return syntax representing this expression + # Syntax of expression # # @return [String] # # @api private abstract_method :syntax - # Return match length for expression + # Match length with other expression # # @param [Expression] other # diff --git a/lib/mutant/expression/method.rb b/lib/mutant/expression/method.rb index 43a17f10..30953f7b 100644 --- a/lib/mutant/expression/method.rb +++ b/lib/mutant/expression/method.rb @@ -20,7 +20,7 @@ module Mutant REGEXP = /\A#{SCOPE_NAME_PATTERN}#{SCOPE_SYMBOL_PATTERN}#{METHOD_NAME_PATTERN}\z/.freeze - # Return syntax + # Syntax of expression # # @return [String] # @@ -30,7 +30,7 @@ module Mutant end memoize :syntax - # Return method matcher + # Matcher for expression # # @param [Env] env # @@ -45,7 +45,7 @@ module Mutant private - # Return scope + # Scope object # # @return [Class, Method] # diff --git a/lib/mutant/expression/methods.rb b/lib/mutant/expression/methods.rb index a32f650b..44813e4f 100644 --- a/lib/mutant/expression/methods.rb +++ b/lib/mutant/expression/methods.rb @@ -14,7 +14,7 @@ module Mutant REGEXP = /\A#{SCOPE_NAME_PATTERN}#{SCOPE_SYMBOL_PATTERN}\z/.freeze - # Return syntax + # Syntax of expression # # @return [String] # @@ -24,7 +24,7 @@ module Mutant end memoize :syntax - # Return method matcher + # Matcher on expression # # @param [Env] env # @@ -35,7 +35,7 @@ module Mutant MATCHERS.fetch(scope_symbol).new(env, scope) end - # Return length of match + # Length of match with other expression # # @param [Expression] expression # @@ -52,7 +52,7 @@ module Mutant private - # Return scope + # Scope object # # @return [Class, Method] # diff --git a/lib/mutant/expression/namespace.rb b/lib/mutant/expression/namespace.rb index 44d2a79d..bfae67d5 100644 --- a/lib/mutant/expression/namespace.rb +++ b/lib/mutant/expression/namespace.rb @@ -23,7 +23,7 @@ module Mutant ) end - # Return the syntax for this expression + # Syntax for expression # # @return [String] # @@ -33,7 +33,7 @@ module Mutant end memoize :syntax - # Return matcher + # Matcher for expression # # @param [Env::Bootstrap] env # @@ -44,7 +44,7 @@ module Mutant Matcher::Namespace.new(env, self) end - # Return length of match + # Length of match with other expression # # @param [Expression] expression # @@ -69,7 +69,7 @@ module Mutant REGEXP = /\A#{SCOPE_NAME_PATTERN}\z/.freeze - # Return matcher + # Matcher matcher on expression # # @param [Env::Bootstrap] env # @@ -80,7 +80,7 @@ module Mutant Matcher::Scope.new(env, Object.const_get(scope_name), self) end - # Return the syntax for this expression + # Syntax for expression # # @return [String] # diff --git a/lib/mutant/expression/parser.rb b/lib/mutant/expression/parser.rb index 677586d2..16b8b191 100644 --- a/lib/mutant/expression/parser.rb +++ b/lib/mutant/expression/parser.rb @@ -51,7 +51,7 @@ module Mutant private - # Return expressions for input + # Expressions parsed from input # # @param [String] input # diff --git a/lib/mutant/integration.rb b/lib/mutant/integration.rb index 20f8c92a..c4e11759 100644 --- a/lib/mutant/integration.rb +++ b/lib/mutant/integration.rb @@ -51,7 +51,7 @@ module Mutant self end - # Return test result for tests + # Run a collection of tests # # @param [Enumerable] tests # @@ -60,7 +60,7 @@ module Mutant # @api private abstract_method :call - # Return all available tests by integration + # Available tests for integration # # @return [Enumerable] # @@ -69,7 +69,7 @@ module Mutant private - # Return expression parser + # Expression parser # # @return [Expression::Parser] # @@ -83,7 +83,7 @@ module Mutant register('null') - # Return all tests + # Available tests for integration # # @return [Enumerable] # @@ -92,7 +92,7 @@ module Mutant EMPTY_ARRAY end - # Return report for test + # Run a collection of tests # # @param [Enumerable] tests # diff --git a/lib/mutant/integration/rspec.rb b/lib/mutant/integration/rspec.rb index 0434ca7b..61219889 100644 --- a/lib/mutant/integration/rspec.rb +++ b/lib/mutant/integration/rspec.rb @@ -52,7 +52,7 @@ module Mutant end memoize :setup - # Return report for test + # Run a collection of tests # # @param [Enumerable] tests # @@ -75,7 +75,7 @@ module Mutant ) end - # Return all available tests + # Available tests # # @return [Enumerable] # @@ -87,7 +87,7 @@ module Mutant private - # Return all tests index + # Index of available tests # # @return [Hash] # diff --git a/lib/mutant/matcher/method/instance.rb b/lib/mutant/matcher/method/instance.rb index 2a6ac31c..433a8b91 100644 --- a/lib/mutant/matcher/method/instance.rb +++ b/lib/mutant/matcher/method/instance.rb @@ -48,9 +48,9 @@ module Mutant private - # Return source location + # Source location # - # @return [Array] + # @return [Array{String,Fixnum}] # # @api private def source_location diff --git a/lib/mutant/matcher/methods.rb b/lib/mutant/matcher/methods.rb index d661dc0c..6a83fea3 100644 --- a/lib/mutant/matcher/methods.rb +++ b/lib/mutant/matcher/methods.rb @@ -23,7 +23,7 @@ module Mutant private - # Return method matcher class + # method matcher class # # @return [Class:Matcher::Method] # @@ -32,7 +32,7 @@ module Mutant self.class::MATCHER end - # Return methods + # Available methods scope # # @return [Enumerable] # @@ -45,7 +45,7 @@ module Mutant end memoize :methods - # Return subjects + # Subjects detected on scope # # @return [Array] # @@ -57,7 +57,7 @@ module Mutant end memoize :subjects - # Return candidate names + # Candidate method names on target scope # # @return [Enumerable] # @@ -70,7 +70,7 @@ module Mutant ).sort end - # Return candidate scope + # Candidate scope # # @return [Class, Module] # @@ -83,7 +83,7 @@ module Mutant private - # Return method for name + # Method object on scope # # @param [Symbol] method_name # @@ -94,7 +94,7 @@ module Mutant scope.method(method_name) end - # Return candidate scope + # Candidate scope # # @return [Class] # @@ -112,7 +112,7 @@ module Mutant private - # Return method for name + # Method object on scope # # @param [Symbol] method_name # @@ -123,7 +123,7 @@ module Mutant scope.instance_method(method_name) end - # Return candidate scope + # Candidate scope # # @return [Class, Module] # diff --git a/lib/mutant/meta/example.rb b/lib/mutant/meta/example.rb index 8e5b2c7f..b0b399f0 100644 --- a/lib/mutant/meta/example.rb +++ b/lib/mutant/meta/example.rb @@ -3,7 +3,7 @@ module Mutant class Example include Adamantium, Concord::Public.new(:file, :node, :mutations) - # Return a verification instance + # Verification instance for example # # @return [Verification] # @@ -12,7 +12,7 @@ module Mutant Verification.new(self, generated) end - # Return source + # Normalized source # # @return [String] # @@ -22,7 +22,7 @@ module Mutant end memoize :source - # Return generated mutations + # Generated mutations on example source # # @return [Enumerable] # @@ -47,7 +47,7 @@ module Mutant unparser.success? && missing.empty? && unexpected.empty? && no_diffs.empty? end - # Return error report + # Error report # # @return [String] # @@ -61,7 +61,7 @@ module Mutant private - # Return unexpected mutations + # Unexpected mutations # # @return [Array] # @@ -71,7 +71,7 @@ module Mutant end memoize :unexpected - # Return mutations with no diff to original + # Mutations with no diff to original # # @return [Enumerable] # @@ -81,7 +81,7 @@ module Mutant end memoize :no_diffs - # Return mutation report + # Mutation report # # @return [String] # @@ -99,7 +99,7 @@ module Mutant ].join("\n======\n") end - # Return missing report + # Missing mutation report # # @return [Array, nil] # @@ -111,7 +111,7 @@ module Mutant ] if missing.any? end - # Return no diff report + # No diff mutation report # # @return [Array, nil] # @@ -125,7 +125,7 @@ module Mutant ] if no_diffs.any? end - # Return unexpected report + # Unexpected mutation report # # @return [Array, nil] # @@ -149,7 +149,7 @@ module Mutant ].join("\n") end - # Return missing mutations + # Missing mutations # # @return [Array] # @@ -159,7 +159,7 @@ module Mutant end memoize :missing - # Return unparser verifier + # Unparser verifier # # @return [Unparser::CLI::Source] # diff --git a/lib/mutant/meta/example/dsl.rb b/lib/mutant/meta/example/dsl.rb index 363a0751..be4ab48b 100644 --- a/lib/mutant/meta/example/dsl.rb +++ b/lib/mutant/meta/example/dsl.rb @@ -28,7 +28,7 @@ module Mutant @expected = [] end - # Return example + # Example captured by DSL # # @return [Example] # diff --git a/lib/mutant/mutation.rb b/lib/mutant/mutation.rb index 34129b35..80d372e2 100644 --- a/lib/mutant/mutation.rb +++ b/lib/mutant/mutation.rb @@ -7,7 +7,7 @@ module Mutant CODE_DELIMITER = "\0".freeze CODE_RANGE = (0..4).freeze - # Return identification + # Identification string # # @return [String] # @@ -17,7 +17,7 @@ module Mutant end memoize :identification - # Return mutation code + # Mutation code # # @return [String] # @@ -27,7 +27,7 @@ module Mutant end memoize :code - # Return source + # Normalized mutation source # # @return [String] # @@ -37,7 +37,7 @@ module Mutant end memoize :source - # Return original source + # Normalized original source # # @return [String] # @@ -75,7 +75,7 @@ module Mutant private - # Return sha1 sum of source and subject identification + # SHA1 sum of source and subject identification # # @return [String] # @@ -85,7 +85,7 @@ module Mutant end memoize :sha1 - # Return mutated root node + # Mutated root node # # @return [Parser::AST::Node] # diff --git a/lib/mutant/mutator.rb b/lib/mutant/mutator.rb index 10c9c03a..90cb9604 100644 --- a/lib/mutant/mutator.rb +++ b/lib/mutant/mutator.rb @@ -32,14 +32,14 @@ module Mutant end private_class_method :handle - # Return input + # Mutation input # # @return [Object] # # @api private attr_reader :input - # Return input + # Parent context of input # # @return [Object] # diff --git a/lib/mutant/mutator/node.rb b/lib/mutant/mutator/node.rb index 6faa3de9..3bcd42e1 100644 --- a/lib/mutant/mutator/node.rb +++ b/lib/mutant/mutator/node.rb @@ -34,21 +34,21 @@ module Mutant private - # Return mutated node + # Node to mutate # # @return [Parser::AST::Node] # # @api private alias_method :node, :input - # Return duplicated node + # Duplicate of original # # @return [Parser::AST::Node] # # @api private alias_method :dup_node, :dup_input - # Return children + # Original nodes children # # @return [Array] # @@ -152,7 +152,7 @@ module Mutant end end - # Return parent node + # Parent node # # @return [Parser::AST::Node] node # if parent with node is present @@ -165,7 +165,7 @@ module Mutant parent.node if parent end - # Return parent type + # Parent type # # @return [Symbol] type # if parent with type is present @@ -187,7 +187,7 @@ module Mutant AST::Types::OP_ASSIGN.include?(parent_type) && parent.node.children.first.equal?(node) end - # Return children indices + # Children indices # # @param [Range] range # diff --git a/lib/mutant/mutator/node/arguments.rb b/lib/mutant/mutator/node/arguments.rb index a25ef802..7f9af537 100644 --- a/lib/mutant/mutator/node/arguments.rb +++ b/lib/mutant/mutator/node/arguments.rb @@ -74,7 +74,7 @@ module Mutant end end - # Return mlhs childs + # Multiple left hand side childs # # @return [Enumerable] # diff --git a/lib/mutant/mutator/node/literal/fixnum.rb b/lib/mutant/mutator/node/literal/fixnum.rb index 9c638d8a..aec9de5d 100644 --- a/lib/mutant/mutator/node/literal/fixnum.rb +++ b/lib/mutant/mutator/node/literal/fixnum.rb @@ -19,7 +19,7 @@ module Mutant emit_values(values) end - # Return values to mutate against + # Values to mutate to # # @return [Array] # @@ -28,7 +28,7 @@ module Mutant [0, 1, -value, value + 1, value - 1] end - # Return value + # Literal original value # # @return [Object] # diff --git a/lib/mutant/mutator/node/literal/float.rb b/lib/mutant/mutator/node/literal/float.rb index 502a798e..361d7c99 100644 --- a/lib/mutant/mutator/node/literal/float.rb +++ b/lib/mutant/mutator/node/literal/float.rb @@ -35,7 +35,7 @@ module Mutant SPECIAL.each(&method(:emit)) end - # Return values to test against + # Values to mutate to # # @return [Array] # diff --git a/lib/mutant/mutator/node/literal/range.rb b/lib/mutant/mutator/node/literal/range.rb index 551e9d42..039362b2 100644 --- a/lib/mutant/mutator/node/literal/range.rb +++ b/lib/mutant/mutator/node/literal/range.rb @@ -29,7 +29,7 @@ module Mutant emit_upper_bound_mutations end - # Return inverse node + # Inverse node # # @return [Parser::AST::Node] # diff --git a/lib/mutant/mutator/node/literal/regex.rb b/lib/mutant/mutator/node/literal/regex.rb index f78a1657..42c4a0e0 100644 --- a/lib/mutant/mutator/node/literal/regex.rb +++ b/lib/mutant/mutator/node/literal/regex.rb @@ -12,7 +12,7 @@ module Mutant private - # Return options + # Original regexp options # # @return [Parser::AST::Node] # diff --git a/lib/mutant/mutator/node/send.rb b/lib/mutant/mutator/node/send.rb index 3533fe8d..f923a49e 100644 --- a/lib/mutant/mutator/node/send.rb +++ b/lib/mutant/mutator/node/send.rb @@ -64,7 +64,7 @@ module Mutant end end - # Return AST metadata for node + # AST metadata for node # # @return [AST::Meta::Send] # @@ -74,7 +74,7 @@ module Mutant end memoize :meta - # Return arguments + # Arguments being send # # @return [Enumerable] # diff --git a/lib/mutant/mutator/node/when.rb b/lib/mutant/mutator/node/when.rb index c45bb872..4441413d 100644 --- a/lib/mutant/mutator/node/when.rb +++ b/lib/mutant/mutator/node/when.rb @@ -45,7 +45,7 @@ module Mutant mutate_child(body_index) end - # Return body node + # Body node # # @return [Parser::AST::Node] # if body is present @@ -58,7 +58,7 @@ module Mutant children[body_index] end - # Return body index + # Index of body node # # @return [Fixnum] # diff --git a/lib/mutant/parallel.rb b/lib/mutant/parallel.rb index c8230a59..0a6662c9 100644 --- a/lib/mutant/parallel.rb +++ b/lib/mutant/parallel.rb @@ -6,7 +6,7 @@ module Mutant class Driver include Concord.new(:binding) - # Return scheduler status + # Scheduler status # # @return [Object] # @@ -48,7 +48,7 @@ module Mutant # @api private abstract_method :result - # Return status + # Sink status # # @return [Object] # diff --git a/lib/mutant/parallel/master.rb b/lib/mutant/parallel/master.rb index 8f55e844..515c8a73 100644 --- a/lib/mutant/parallel/master.rb +++ b/lib/mutant/parallel/master.rb @@ -143,7 +143,7 @@ module Mutant sender.call(Actor::Message.new(:job, next_job)) end - # Return next job if any + # Next job if any # # @return [Job] # if next job is available @@ -182,7 +182,7 @@ module Mutant @stop || !source.next? || sink.stop? end - # Return source + # Job source # # @return [Source] # @@ -191,7 +191,7 @@ module Mutant config.source end - # Return sink + # Job result sink # # @return [Sink] # diff --git a/lib/mutant/parallel/source.rb b/lib/mutant/parallel/source.rb index 1df9573c..2d5c605e 100644 --- a/lib/mutant/parallel/source.rb +++ b/lib/mutant/parallel/source.rb @@ -6,7 +6,7 @@ module Mutant NoJobError = Class.new(RuntimeError) - # Return next job + # Next job # # @return [Object] # @@ -47,7 +47,7 @@ module Mutant @next_index < jobs.length end - # Return next job + # Next job # # @return [Object] # diff --git a/lib/mutant/reporter/cli.rb b/lib/mutant/reporter/cli.rb index 113a6daf..213082dc 100644 --- a/lib/mutant/reporter/cli.rb +++ b/lib/mutant/reporter/cli.rb @@ -46,7 +46,7 @@ module Mutant self end - # Return report delay in seconds + # Report delay in seconds # # TODO: Move this to a callback registration # diff --git a/lib/mutant/reporter/cli/format.rb b/lib/mutant/reporter/cli/format.rb index d1516ff7..49629971 100644 --- a/lib/mutant/reporter/cli/format.rb +++ b/lib/mutant/reporter/cli/format.rb @@ -5,7 +5,7 @@ module Mutant class Format include AbstractType, Anima.new(:tty) - # Return start representation + # Start representation # # @param [Env] env # @@ -14,7 +14,7 @@ module Mutant # @api private abstract_method :start - # Return progress representation + # Progress representation # # @param [Runner::Status] status # @@ -23,7 +23,7 @@ module Mutant # @api private abstract_method :progress - # Return report delay in seconds + # Report delay in seconds # # @return [Float] # @@ -75,7 +75,7 @@ module Mutant REPORT_FREQUENCY = 1.0 REPORT_DELAY = 1 / REPORT_FREQUENCY - # Return start representation + # Start representation # # @return [String] # @@ -84,7 +84,7 @@ module Mutant format(Printer::Config, env.config) end - # Return progress representation + # Progress representation # # @return [String] # @@ -95,7 +95,7 @@ module Mutant private - # Return new buffer + # New buffer # # @return [StringIO] # @@ -139,7 +139,7 @@ module Mutant private - # Return new buffer + # New buffer # # @return [StringIO] # diff --git a/lib/mutant/reporter/cli/printer.rb b/lib/mutant/reporter/cli/printer.rb index c91d0d99..c7c8ce3e 100644 --- a/lib/mutant/reporter/cli/printer.rb +++ b/lib/mutant/reporter/cli/printer.rb @@ -20,7 +20,7 @@ module Mutant private - # Return status color + # Status color # # @return [Color] # diff --git a/lib/mutant/reporter/cli/printer/env_progress.rb b/lib/mutant/reporter/cli/printer/env_progress.rb index 395d4c25..728d6a1c 100644 --- a/lib/mutant/reporter/cli/printer/env_progress.rb +++ b/lib/mutant/reporter/cli/printer/env_progress.rb @@ -38,7 +38,7 @@ module Mutant private - # Return coverage percent + # Coverage in percent # # @return [Float] # @@ -47,7 +47,7 @@ module Mutant coverage * 100 end - # Return overhead percent + # Overhead in percent # # @return [Float] # diff --git a/lib/mutant/reporter/cli/printer/mutation_result.rb b/lib/mutant/reporter/cli/printer/mutation_result.rb index a1d17707..1025aaaa 100644 --- a/lib/mutant/reporter/cli/printer/mutation_result.rb +++ b/lib/mutant/reporter/cli/printer/mutation_result.rb @@ -59,7 +59,7 @@ module Mutant private - # Return details + # Print mutation details # # @return [undefined] # @@ -68,7 +68,7 @@ module Mutant __send__(MAP.fetch(mutation.class)) end - # Return evil details + # Evil mutation details # # @return [String] # @@ -127,7 +127,7 @@ module Mutant visit(TestResult, test_result) end - # Return original node + # Original node # # @return [Parser::AST::Node] # diff --git a/lib/mutant/reporter/cli/printer/status.rb b/lib/mutant/reporter/cli/printer/status.rb index 0cea4d1c..56bbfc1a 100644 --- a/lib/mutant/reporter/cli/printer/status.rb +++ b/lib/mutant/reporter/cli/printer/status.rb @@ -37,7 +37,7 @@ module Mutant end end - # Return active subject results + # Active subject results # # @return [Array] # diff --git a/lib/mutant/reporter/cli/printer/status_progressive.rb b/lib/mutant/reporter/cli/printer/status_progressive.rb index 06058bc7..842b1f16 100644 --- a/lib/mutant/reporter/cli/printer/status_progressive.rb +++ b/lib/mutant/reporter/cli/printer/status_progressive.rb @@ -35,7 +35,7 @@ module Mutant private - # Return object being printed + # Object being printed # # @return [Result::Env] # diff --git a/lib/mutant/reporter/cli/tput.rb b/lib/mutant/reporter/cli/tput.rb index 15b509a3..f4eb577f 100644 --- a/lib/mutant/reporter/cli/tput.rb +++ b/lib/mutant/reporter/cli/tput.rb @@ -7,7 +7,7 @@ module Mutant private_class_method :new - # Return detected tput support + # Detected tput support # # @return [Tput] # if tput support is present diff --git a/lib/mutant/reporter/trace.rb b/lib/mutant/reporter/trace.rb index 5c74c3fb..dd2100ba 100644 --- a/lib/mutant/reporter/trace.rb +++ b/lib/mutant/reporter/trace.rb @@ -4,7 +4,7 @@ module Mutant class Trace include Adamantium::Mutable, Anima.new(:start_calls, :progress_calls, :report_calls, :warn_calls) - # Return new trace reporter + # New trace reporter # # @return [Trace] # @@ -22,7 +22,7 @@ module Mutant REPORT_DELAY = 0.0 - # Return report delay + # Report delay # # @return [Float] # diff --git a/lib/mutant/result.rb b/lib/mutant/result.rb index cf02aa84..92f04322 100644 --- a/lib/mutant/result.rb +++ b/lib/mutant/result.rb @@ -5,7 +5,7 @@ module Mutant # Coverage mixin module Coverage - # Return coverage + # Observed coverage # # @return [Rational] # @@ -53,7 +53,11 @@ module Mutant end end # ClassMethods - # Return overhead + # Mutant overhead running mutatet tests + # + # This is NOT the overhead of mutation testing, just an engine specific + # measurement for the efficiency of the parellelization engine, kill + # isolation etc. # # @return [Float] # @@ -90,7 +94,7 @@ module Mutant end memoize :success? - # Return failed subject results + # Failed subject results # # @return [Array] # @@ -104,7 +108,7 @@ module Mutant sum :amount_mutations_killed, :subject_results sum :killtime, :subject_results - # Return amount of mutations + # Amount of mutations # # @return [Fixnum] # @@ -113,7 +117,7 @@ module Mutant env.mutations.length end - # Return amount of subjects + # Amount of subjects # # @return [Fixnum] # @@ -159,7 +163,7 @@ module Mutant mutation_results.all?(&:success?) end - # Return killed mutations + # Killed mutations # # @return [Array] # @@ -169,7 +173,7 @@ module Mutant end memoize :alive_mutation_results - # Return amount of mutations + # Amount of mutations # # @return [Fixnum] # @@ -178,7 +182,7 @@ module Mutant mutation_results.length end - # Return amount of mutations + # Amount of mutations # # @return [Fixnum] # @@ -187,7 +191,7 @@ module Mutant subject.mutations.length end - # Return number of killed mutations + # Number of killed mutations # # @return [Fixnum] # @@ -196,7 +200,7 @@ module Mutant killed_mutation_results.length end - # Return number of alive mutations + # Number of alive mutations # # @return [Fixnum] # @@ -205,7 +209,7 @@ module Mutant alive_mutation_results.length end - # Return alive mutations + # Alive mutations # # @return [Array] # @@ -221,7 +225,7 @@ module Mutant class Mutation include Result, Anima.new(:mutation, :test_result) - # Return runtime + # The runtime # # @return [Float] # diff --git a/lib/mutant/runner.rb b/lib/mutant/runner.rb index c459b8e4..030a777c 100644 --- a/lib/mutant/runner.rb +++ b/lib/mutant/runner.rb @@ -16,7 +16,7 @@ module Mutant run_mutation_analysis end - # Return result + # Final result # # @return [Result::Env] # @@ -58,7 +58,7 @@ module Mutant status.payload end - # Return mutation test config + # Confiugation for paralell execution engine # # @return [Parallell::Config] # @@ -73,7 +73,7 @@ module Mutant ) end - # Return reporter + # Reporter to use # # @return [Reporter] # @@ -82,7 +82,7 @@ module Mutant env.config.reporter end - # Return config + # Config for this mutant execution # # @return [Config] # diff --git a/lib/mutant/runner/sink.rb b/lib/mutant/runner/sink.rb index 1ef29ff8..def241d0 100644 --- a/lib/mutant/runner/sink.rb +++ b/lib/mutant/runner/sink.rb @@ -4,7 +4,7 @@ module Mutant class Sink include AbstractType - # Return sink status + # sink status # # @return [Object] # @@ -48,7 +48,7 @@ module Mutant end end - # Return runner status + # Runner status # # @return [Status] # @@ -88,7 +88,7 @@ module Mutant private - # Return current result + # Current result # # @return [Result::Env] # diff --git a/lib/mutant/selector.rb b/lib/mutant/selector.rb index aed09876..b7f00555 100644 --- a/lib/mutant/selector.rb +++ b/lib/mutant/selector.rb @@ -3,7 +3,7 @@ module Mutant class Selector include AbstractType, Adamantium::Flat - # Return tests for subject + # Tests for subject # # @param [Subject] subjecto # diff --git a/lib/mutant/selector/expression.rb b/lib/mutant/selector/expression.rb index 66fbe841..f07fc960 100644 --- a/lib/mutant/selector/expression.rb +++ b/lib/mutant/selector/expression.rb @@ -4,7 +4,7 @@ module Mutant class Expression < self include Concord.new(:integration) - # Return tests for subject + # Tests for subject # # @param [Subject] subject # diff --git a/lib/mutant/subject.rb b/lib/mutant/subject.rb index 26013c92..33599317 100644 --- a/lib/mutant/subject.rb +++ b/lib/mutant/subject.rb @@ -4,7 +4,7 @@ module Mutant include AbstractType, Adamantium::Flat, Enumerable include Concord::Public.new(:context, :node) - # Return mutations + # Mutations for this subject # # @return [Enumerable] # @return [undefined] @@ -19,7 +19,7 @@ module Mutant end memoize :mutations - # Return source path + # Source path # # @return [String] # @@ -28,7 +28,7 @@ module Mutant context.source_path end - # Prepare the subject for the insertion of mutation + # Prepare subject for insertion of mutation # # @return [self] # @@ -37,7 +37,7 @@ module Mutant self end - # Return source lines + # Source line range # # @return [Range] # @@ -48,7 +48,7 @@ module Mutant end memoize :source_lines - # Return source line + # First source line # # @return [Fixnum] # @@ -57,7 +57,7 @@ module Mutant source_lines.begin end - # Return subject identification + # Identification string # # @return [String] # @@ -67,7 +67,7 @@ module Mutant end memoize :identification - # Return source representation of ast + # Source representation of AST # # @return [String] # @@ -77,14 +77,14 @@ module Mutant end memoize :source - # Return match expression + # Match expression # # @return [Expression] # # @api private abstract_method :expression - # Return match expressions + # Match expressions # # @return [Enumerable] # @@ -93,7 +93,7 @@ module Mutant private - # Return neutral mutation + # Neutral mutation # # @return [Mutation::Neutral] # diff --git a/lib/mutant/subject/method.rb b/lib/mutant/subject/method.rb index 1baac54a..2d0f294c 100644 --- a/lib/mutant/subject/method.rb +++ b/lib/mutant/subject/method.rb @@ -10,7 +10,7 @@ module Mutant # @api private abstract_method :public? - # Return method name + # Method name # # @return [Expression] # @@ -19,7 +19,7 @@ module Mutant node.children.fetch(self.class::NAME_INDEX) end - # Return match expression + # Match expression # # @return [String] # @@ -33,7 +33,7 @@ module Mutant end memoize :expression - # Return match expressions + # Match expressions # # @return [Array] # @@ -45,7 +45,7 @@ module Mutant private - # Return scope + # The scope # # @return [Class, Module] # diff --git a/lib/mutant/subject/method/instance.rb b/lib/mutant/subject/method/instance.rb index c99b2087..085c8206 100644 --- a/lib/mutant/subject/method/instance.rb +++ b/lib/mutant/subject/method/instance.rb @@ -44,7 +44,7 @@ module Mutant private - # Return memoizer node for mutant + # Memoizer node for mutant # # @param [Parser::AST::Node] mutant # diff --git a/lib/mutant/test.rb b/lib/mutant/test.rb index 31bc03e3..7f32271b 100644 --- a/lib/mutant/test.rb +++ b/lib/mutant/test.rb @@ -3,7 +3,7 @@ module Mutant class Test include Adamantium::Flat, Anima.new(:id, :expression) - # Return test identification + # Identification string # # @return [String] # diff --git a/lib/mutant/version.rb b/lib/mutant/version.rb index 4f697f77..afe16323 100644 --- a/lib/mutant/version.rb +++ b/lib/mutant/version.rb @@ -1,4 +1,4 @@ module Mutant - # The current mutant version + # Current mutant version VERSION = '0.8.0'.freeze end # Mutant diff --git a/lib/mutant/warning_filter.rb b/lib/mutant/warning_filter.rb index 7505f3bf..7c816850 100644 --- a/lib/mutant/warning_filter.rb +++ b/lib/mutant/warning_filter.rb @@ -17,14 +17,14 @@ module Mutant @warnings = [] end - # Return filtered warnings + # Warnings captured by filter # # @return [Array] # # @api private attr_reader :warnings - # Return target + # Target stream to capture warnings on # # @return [#write] target # diff --git a/lib/mutant/zombifier.rb b/lib/mutant/zombifier.rb index 348345f1..2b396a7c 100644 --- a/lib/mutant/zombifier.rb +++ b/lib/mutant/zombifier.rb @@ -112,7 +112,7 @@ module Mutant ) end - # Return namespaced root + # Namespaced root node # # @param [Symbol] namespace # diff --git a/spec/support/corpus.rb b/spec/support/corpus.rb index f9d0e7a0..6b80382e 100644 --- a/spec/support/corpus.rb +++ b/spec/support/corpus.rb @@ -142,7 +142,7 @@ module MutantSpec # Not in the docs. Number from chatting with their support. CIRCLE_CI_CONTAINER_PROCESSES = 2 - # Return number of parallel processes to use + # Number of parallel processes to use # # @return [Fixnum] # @@ -155,7 +155,7 @@ module MutantSpec end end - # Return repository path + # Repository path # # @return [Pathname] # From 6df33c2ad810d9369dc50bd6a6060edb6742c42f Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Fri, 3 Jul 2015 15:24:31 +0000 Subject: [PATCH 3/3] Fix yardstick coverage --- lib/mutant/matcher/filter.rb | 5 ++--- lib/mutant/parallel/master.rb | 2 ++ lib/mutant/runner.rb | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/mutant/matcher/filter.rb b/lib/mutant/matcher/filter.rb index bc750438..61f59027 100644 --- a/lib/mutant/matcher/filter.rb +++ b/lib/mutant/matcher/filter.rb @@ -4,14 +4,13 @@ module Mutant class Filter < self include Concord.new(:matcher, :predicate) - # Return new matcher + # New matcher # - # @return [Matcher] matcher + # @param [Matcher] matcher # # @return [Matcher] # # @api private - # def self.build(matcher, &predicate) new(matcher, predicate) end diff --git a/lib/mutant/parallel/master.rb b/lib/mutant/parallel/master.rb index 515c8a73..7e3f0dc4 100644 --- a/lib/mutant/parallel/master.rb +++ b/lib/mutant/parallel/master.rb @@ -39,6 +39,8 @@ module Mutant # # rubocop:disable MethodLength # + # @return [undefined] + # # @api private def run config.jobs.times do diff --git a/lib/mutant/runner.rb b/lib/mutant/runner.rb index 030a777c..6b400461 100644 --- a/lib/mutant/runner.rb +++ b/lib/mutant/runner.rb @@ -27,9 +27,9 @@ module Mutant # Run mutation analysis # - # @return [undefined] + # @return [undefined] # - # @api private + # @api private def run_mutation_analysis @result = run_driver(Parallel.async(mutation_test_config)) reporter.report(@result)