Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove yard docs for private methods #1021

Merged
merged 1 commit into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
ruby-mutant:
name: Mutation coverage
runs-on: ${{ matrix.os }}
timeout-minutes: 5
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
Expand All @@ -47,7 +47,7 @@ jobs:
- run: |
gem install bundler
bundle install
- run: bundle exec mutant --since HEAD~1 --zombie -- 'Mutant*'
- run: ./mutant.sh
ruby-integration-minitest:
name: Integration Minitest
runs-on: ${{ matrix.os }}
Expand Down
9 changes: 0 additions & 9 deletions lib/mutant/ast.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ def self.find_last_path(node, &predicate)
path
end

# Walk all ast nodes keeping track of path
#
# @param [Parser::AST::Node] root
# @param [Array<Parser::AST::Node>] stack
#
# @yield [Parser::AST::Node]
# all nodes visited recursively including root
#
# @return [undefined]
def self.walk(node, stack, &block)
block.call(node, stack)
node.children.grep(::Parser::AST::Node) do |child|
Expand Down
6 changes: 0 additions & 6 deletions lib/mutant/ast/meta/send.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,10 @@ def receiver_possible_top_level_const?

private

# Test if node is `proc { ... }`
#
# @return [Boolean]
def naked_proc?
!receiver && selector.equal?(:proc)
end

# Test if node is `Proc.new { ... }`
#
# @return [Boolean]
def proc_new?
receiver &&
selector.equal?(:new) &&
Expand Down
36 changes: 0 additions & 36 deletions lib/mutant/bootstrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ def self.apply(world, config)
end
# rubocop:enable Metrics/MethodLength

# Infect environment
#
# @return [undefined]
def self.infect(env)
config, world = env.config, env.world

Expand All @@ -60,12 +57,6 @@ def self.infect(env)
end
private_class_method :infect

# Matchable scopes
#
# @param [World] world
# @param [Config] config
#
# @return [Array<Scope>]
def self.matchable_scopes(world, config)
scopes = world.object_space.each_object(Module).each_with_object([]) do |scope, aggregate|
expression = expression(config.reporter, config.expression_parser, scope) || next
Expand All @@ -76,15 +67,6 @@ def self.matchable_scopes(world, config)
end
private_class_method :matchable_scopes

# Scope name from scoping object
#
# @param [Class, Module] scope
#
# @return [String]
# if scope has a name and does not raise exceptions obtaining it
#
# @return [nil]
# otherwise
def self.scope_name(reporter, scope)
scope.name
rescue => exception
Expand All @@ -99,20 +81,7 @@ def self.scope_name(reporter, scope)
end
private_class_method :scope_name

# Try to turn scope into expression
#
# @param [Expression::Parser] expression_parser
# @param [Class, Module] scope
#
# @return [Expression]
# if scope can be represented in an expression
#
# @return [nil]
# otherwise
#
# rubocop:disable Metrics/MethodLength
#
# ignore :reek:LongParameterList
def self.expression(reporter, expression_parser, scope)
name = scope_name(reporter, scope) or return

Expand All @@ -132,11 +101,6 @@ def self.expression(reporter, expression_parser, scope)
private_class_method :expression
# rubocop:enable Metrics/MethodLength

# Write a semantics warning
#
# @return [undefined]
#
# ignore :reek:LongParameterList
def self.semantics_warning(reporter, format, options)
reporter.warn(SEMANTICS_MESSAGE_FORMAT % { message: format % options })
end
Expand Down
54 changes: 5 additions & 49 deletions lib/mutant/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,12 @@ def parse(arguments)

private

# Parse matchers
#
# @param [Array<String>] expressions
#
# @return [undefined]
def parse_match_expressions(expressions)
expressions.each do |expression|
add_matcher(:match_expressions, config.expression_parser.apply(expression).from_right)
end
end

# Add environmental options
#
# @param [Object] opts
#
# @return [undefined]
#
# rubocop:disable Metrics/MethodLength
def add_environment_options(opts)
opts.separator('Environment:')
Expand All @@ -121,12 +110,8 @@ def add_environment_options(opts)
with(jobs: Integer(number))
end
end
# rubocop:enable Metrics/MethodLength

# Add mutation options
#
# @param [OptionParser] opts
#
# @return [undefined]
def add_mutation_options(opts)
opts.separator(nil)
opts.separator('Options:')
Expand All @@ -136,11 +121,7 @@ def add_mutation_options(opts)
end
end

# Add filter options
#
# @param [OptionParser] opts
#
# @return [undefined]
# rubocop:disable Metrics/MethodLength
def add_filter_options(opts)
opts.on('--ignore-subject EXPRESSION', 'Ignore subjects that match EXPRESSION as prefix') do |pattern|
add_matcher(:ignore_expressions, config.expression_parser.apply(pattern).from_right)
Expand All @@ -154,12 +135,9 @@ def add_filter_options(opts)
)
end
end
# rubocop:enable Metrics/MethodLength

# Add debug options
#
# @param [OptionParser] opts
#
# @return [undefined]
# rubocop:disable Metrics/MethodLength
def add_debug_options(opts)
opts.on('--fail-fast', 'Fail fast') do
with(fail_fast: true)
Expand All @@ -173,38 +151,16 @@ def add_debug_options(opts)
world.kernel.exit
end
end
# rubocop:enable Metrics/MethodLength

# With configuration
#
# @param [Hash<Symbol, Object>] attributes
#
# @return [undefined]
def with(attributes)
@config = config.with(attributes)
end

# Add configuration
#
# @param [Symbol] attribute
# the attribute to add to
#
# @param [Object] value
# the value to add
#
# @return [undefined]
def add(attribute, value)
with(attribute => config.public_send(attribute) + [value])
end

# Add matcher configuration
#
# @param [Symbol] attribute
# the attribute to add to
#
# @param [Object] value
# the value to add
#
# @return [undefined]
def add_matcher(attribute, value)
with(matcher: config.matcher.add(attribute, value))
end
Expand Down
3 changes: 0 additions & 3 deletions lib/mutant/color.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ def format(text)

private

# Initialize null color
#
# @return [undefined]
def initialize; end

end.new
Expand Down
8 changes: 0 additions & 8 deletions lib/mutant/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,6 @@ def self.load_config_file(world, config)
end
end

# Load contents of file
#
# @param [Pathname] path
#
# @return [Config]
#
# @raise [Either<String, Hash{Symbol => Object}>]
# in case of config file error
def self.load_contents(path)
Transform::Named
.new(path.to_s, TRANSFORM)
Expand Down
3 changes: 0 additions & 3 deletions lib/mutant/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ def match_expressions

private

# Nesting of names in scope
#
# @return [Array<String>]
def name_nesting
scope.name.split(NAMESPACE_DELIMITER)
end
Expand Down
17 changes: 0 additions & 17 deletions lib/mutant/diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,16 @@ def self.lines(source)

private

# Diffs between old and new
#
# @return [Array<Array>]
def diffs
::Diff::LCS.diff(old, new)
end

# Raw diff-lcs hunks
#
# @return [Array<Diff::LCS::Hunk>]
def hunks
diffs.map do |diff|
::Diff::LCS::Hunk.new(old.map(&:dup), new, diff, max_length, 0)
end
end

# Minimized hunk
#
# @return Diff::LCS::Hunk
def minimized_hunk
head, *tail = hunks

Expand All @@ -86,18 +77,10 @@ def minimized_hunk
end
end

# Max length of source line in new and old
#
# @return [Integer]
def max_length
[old, new].map(&:length).max
end

# Colorized a unified diff line
#
# @param [String] line
#
# @return [String]
def self.colorize_line(line)
case line[0]
when ADDITION
Expand Down
6 changes: 0 additions & 6 deletions lib/mutant/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ def test_subject_ratio

private

# Kill mutation under isolation with integration
#
# @param [Mutation] mutation
# @param [Array<Test>] test
#
# @return [Result::Isolation]
def run_mutation_tests(mutation, tests)
config.isolation.call do
result = mutation.insert(world.kernel)
Expand Down
3 changes: 0 additions & 3 deletions lib/mutant/expression/method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ def matcher

private

# Scope object
#
# @return [Class, Method]
def scope
Object.const_get(scope_name)
end
Expand Down
3 changes: 0 additions & 3 deletions lib/mutant/expression/methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ def match_length(expression)

private

# Scope object
#
# @return [Class, Method]
def scope
Object.const_get(scope_name)
end
Expand Down
6 changes: 0 additions & 6 deletions lib/mutant/expression/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ def apply(input)

private

# Expressions parsed from input
#
# @param [String] input
#
# @return [Array<Expression>]
# if expressions can be parsed from input
def expressions(input)
types.each_with_object([]) do |type, aggregate|
expression = type.try_parse(input) and aggregate << expression
Expand Down
18 changes: 0 additions & 18 deletions lib/mutant/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ def self.setup(env)
.fmap { |klass| klass.new(env.config).setup }
end

# Attempt to require integration
#
# @param env [Bootstrap]
#
# @return [Either<String, undefined>]
#
# @api private
#
# rubocop:disable Style/MultilineBlockChain
def self.attempt_require(env)
integration_name = env.config.integration
Expand All @@ -56,13 +48,6 @@ def self.attempt_require(env)
private_class_method :attempt_require
# rubocop:enable Style/MultilineBlockChain

# Attempt const get
#
# @param env [Boostrap]
#
# @return [Either<String, Class<Integration>>]
#
# @api private
def self.attempt_const_get(env)
integration_name = env.config.integration
constant_name = integration_name.capitalize
Expand Down Expand Up @@ -98,9 +83,6 @@ def setup

private

# Expression parser
#
# @return [Expression::Parser]
def expression_parser
config.expression_parser
end
Expand Down
Loading