Skip to content

Commit

Permalink
Merge pull request #993 from mbj/add/parser-2.7-support
Browse files Browse the repository at this point in the history
Change to allow parser 2.7 series
  • Loading branch information
mbj committed Feb 2, 2020
2 parents 6fd7694 + 533f5ed commit 60f8c72
Show file tree
Hide file tree
Showing 20 changed files with 99 additions and 85 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
@@ -1,3 +1,8 @@
# v0.9.5 2020-02-02

* Change to 2.7 parser series.
This does not drop support for < 2.7 but enables to in the future add full Ruby 2.7 support.

# v0.9.4 2020-01-03

* Bump unparser dependency
Expand Down
8 changes: 0 additions & 8 deletions Gemfile
Expand Up @@ -6,14 +6,6 @@ gemspec name: 'mutant'

eval_gemfile File.expand_path('Gemfile.shared', __dir__)

gem 'unparser', git: 'https://github.com/mbj/unparser.git'

gem(
'devtools',
git: 'https://github.com/mbj/devtools.git',
ref: '26ba0a1053e6cf7b79fc72d513a73457f9a38ead'
)

# Mutant itself uses an opensource license key.
# Scoped to https://github.com/mbj/mutant it'll
# not be useful elsewhere.
Expand Down
84 changes: 35 additions & 49 deletions Gemfile.lock
@@ -1,39 +1,3 @@
GIT
remote: https://github.com/mbj/devtools.git
revision: 26ba0a1053e6cf7b79fc72d513a73457f9a38ead
ref: 26ba0a1053e6cf7b79fc72d513a73457f9a38ead
specs:
devtools (0.1.23)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
anima (~> 0.3.0)
concord (~> 0.1.5)
flay (~> 2.12.0)
flog (~> 4.6.2)
procto (~> 0.0.3)
rake (~> 12.3.0)
reek (~> 5.3.0)
rspec (~> 3.8.0)
rspec-core (~> 3.8.0)
rspec-its (~> 1.2.0)
rubocop (~> 0.61.1)
simplecov (~> 0.16.1)
yard (~> 0.9.16)
yardstick (~> 0.9.9)

GIT
remote: https://github.com/mbj/unparser.git
revision: 157a5b3b43e9f1d540da74b1751dc2b6f7601c3b
specs:
unparser (0.4.6)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
concord (~> 0.1.5)
diff-lcs (~> 1.3)
equalizer (~> 0.0.9)
parser (~> 2.6.5)
procto (~> 0.0.2)

PATH
remote: .
specs:
Expand All @@ -48,7 +12,7 @@ PATH
ice_nine (~> 0.11.1)
memoizable (~> 0.4.2)
mprelude (~> 0.1.0)
parser (~> 2.6.5)
parser (~> 2.7.0.2)
procto (~> 0.0.2)
unparser (~> 0.4.6)

Expand Down Expand Up @@ -78,6 +42,23 @@ GEM
equalizer (~> 0.0.9)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
devtools (0.1.25)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
anima (~> 0.3.0)
concord (~> 0.1.5)
flay (~> 2.12.0)
flog (~> 4.6.2)
procto (~> 0.0.3)
rake (~> 12.3.0)
reek (~> 5.6.0)
rspec (~> 3.8.0)
rspec-core (~> 3.8.0)
rspec-its (~> 1.2.0)
rubocop (~> 0.79.0)
simplecov (~> 0.16.1)
yard (~> 0.9.16)
yardstick (~> 0.9.9)
diff-lcs (1.3)
docile (1.3.2)
equalizer (0.0.11)
Expand Down Expand Up @@ -106,18 +87,17 @@ GEM
procto (~> 0.0.2)
mutant-license (0.1.0)
parallel (1.19.1)
parser (2.6.5.0)
parser (2.7.0.2)
ast (~> 2.4.0)
path_expander (1.1.0)
powerpack (0.1.2)
procto (0.0.3)
psych (3.1.0)
rainbow (3.0.0)
rake (12.3.3)
reek (5.3.2)
reek (5.6.0)
codeclimate-engine-rb (~> 0.4.0)
kwalify (~> 0.7.0)
parser (>= 2.5.0.0, < 2.7, != 2.5.1.1)
parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
psych (~> 3.1.0)
rainbow (>= 2.0, < 4.0)
rspec (3.8.0)
Expand All @@ -136,14 +116,13 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.3)
rubocop (0.61.1)
rubocop (0.79.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.4.0)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.1)
ruby_parser (3.14.1)
sexp_processor (~> 4.9)
Expand All @@ -154,25 +133,32 @@ GEM
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
thread_safe (0.3.6)
unicode-display_width (1.4.1)
unicode-display_width (1.6.1)
unparser (0.4.7)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
concord (~> 0.1.5)
diff-lcs (~> 1.3)
equalizer (~> 0.0.9)
parser (>= 2.6.5)
procto (~> 0.0.2)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
yard (0.9.22)
yard (0.9.24)
yardstick (0.9.9)
yard (~> 0.8, >= 0.8.7.2)

PLATFORMS
ruby

DEPENDENCIES
devtools!
devtools (~> 0.1.25)
mutant!
mutant-license!
parallel (~> 1.3)
unparser!

BUNDLED WITH
1.17.3
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -29,6 +29,15 @@ On each detection of uncovered semantics you have the opportunity to:
to test only the code you had been touching. See the [incremental](#only-mutating-changed-code)
mutation testing documentation.

## Ruby Versions

Mutant currently only works on cRuby/MRI. Starting with version 2.5.x. It supports all syntax features upto and
including Ruby 2.6.

Support for 2.7 syntax features is pending, see unparser issue: https://github.com/mbj/unparser/issues/129.

Mutant will work under Ruby 2.7 just fine, unless a 2.7 syntax feature is used. This will be resolved shortly.

## Licensing

Mutant was recently transitioned commercial software, with a free usage plan for opensource projects.
Expand Down
13 changes: 10 additions & 3 deletions config/rubocop.yml
Expand Up @@ -99,7 +99,7 @@ ClassCheck:
EnforcedStyle: kind_of?

# Do not prefer double quotes to be used when %q or %Q is more appropriate
UnneededPercentQ:
Style/RedundantPercentQ:
Enabled: false

# Allow a maximum ABC score
Expand Down Expand Up @@ -145,7 +145,7 @@ Alias:
EnforcedStyle: prefer_alias_method

# Do not waste my horizontal or vertical space
IndentArray:
Layout/FirstArrayElementIndentation:
Enabled: false

# Prefer
Expand All @@ -167,7 +167,7 @@ MultilineMethodCallIndentation:
Send:
Enabled: true

Layout/AlignHash:
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedHashRocketStyle: table
Layout/EmptyLineAfterGuardClause:
Expand Down Expand Up @@ -196,3 +196,10 @@ Style/RescueStandardError:
Enabled: false
Style/StderrPuts:
Enabled: false
# suggesting single letter variablesl bah
Naming/RescuedExceptionsVariableName:
Enabled: false
# false positive on private keywords
Layout/IndentationWidth:
Enabled: false

2 changes: 1 addition & 1 deletion lib/mutant/cli.rb
Expand Up @@ -105,7 +105,7 @@ def parse_match_expressions(expressions)
#
# @return [undefined]
#
# rubocop:disable MethodLength
# rubocop:disable Metrics/MethodLength
def add_environment_options(opts)
opts.separator('Environment:')
opts.on('--zombie', 'Run mutant zombified') do
Expand Down
2 changes: 1 addition & 1 deletion lib/mutant/integration/minitest.rb
Expand Up @@ -79,7 +79,7 @@ def setup
#
# @return [Result::Test]
#
# rubocop:disable MethodLength
# rubocop:disable Metrics/MethodLength
#
# ignore :reek:TooManyStatements
def call(tests)
Expand Down
2 changes: 1 addition & 1 deletion lib/mutant/integration/rspec.rb
Expand Up @@ -55,7 +55,7 @@ def setup
#
# @return [Result::Test]
#
# rubocop:disable MethodLength
# rubocop:disable Metrics/MethodLength
def call(tests)
examples = tests.map(&all_tests_index.method(:fetch))
filter_examples(&examples.method(:include?))
Expand Down
4 changes: 1 addition & 3 deletions lib/mutant/meta.rb
Expand Up @@ -10,14 +10,12 @@ module Meta
# Mutation example
class Example

# rubocop:disable MutableConstant
# rubocop:disable Style/MutableConstant
ALL = []

# Add example
#
# @return [undefined]
#
# rubocop:disable Performance/Caller
def self.add(*types, &block)
file = caller.first.split(':in', 2).first
ALL << DSL.call(file, Set.new(types), block)
Expand Down
2 changes: 1 addition & 1 deletion lib/mutant/meta/example/verification.rb
Expand Up @@ -61,7 +61,7 @@ def missing
def invalid_syntax
mutations.reject do |mutation|
::Parser::CurrentRuby.parse(mutation.source)
rescue ::Parser::SyntaxError # rubocop:disable Lint/HandleExceptions
rescue ::Parser::SyntaxError # rubocop:disable Lint/SuppressedException
end
end
memoize :invalid_syntax
Expand Down
20 changes: 18 additions & 2 deletions lib/mutant/mutator/node/generic.rb
Expand Up @@ -12,28 +12,43 @@ class Generic < self
__LINE__
alias
arg_expr
array_pattern
array_pattern_with_tail
back_ref
blockarg
blockarg_expr
case_match
complex
const_pattern
eflipflop
empty
ensure
for
forward_args
forwarded_args
hash_pattern
ident
if_guard
iflipflop
in_match
in_pattern
kwnilarg
kwrestarg
kwsplat
match_alt
match_as
match_nil_pattern
match_rest
match_var
match_with_lvasgn
meth_ref
match_with_trailing_comma
module
numargs
numblock
numparam
objc_kwarg
objc_restarg
objc_varargs
pin
postexe
preexe
rational
Expand All @@ -45,6 +60,7 @@ class Generic < self
sclass
shadowarg
undef
unless_guard
until_post
while_post
xstr
Expand Down
2 changes: 1 addition & 1 deletion lib/mutant/mutator/node/send.rb
Expand Up @@ -5,7 +5,7 @@ class Mutator
class Node

# Namespace for send mutators
# rubocop:disable ClassLength
# rubocop:disable Metrics/ClassLength
class Send < self
include AST::Types

Expand Down
2 changes: 1 addition & 1 deletion lib/mutant/reporter/cli/format.rb
Expand Up @@ -5,7 +5,7 @@ class Reporter
class CLI
# CLI output format
#
# rubocop:disable FormatString
# rubocop:disable Style/FormatString
class Format
include AbstractType, Concord.new(:tty)

Expand Down
2 changes: 2 additions & 0 deletions lib/mutant/zombifier.rb
Expand Up @@ -17,7 +17,9 @@ class Zombifier

include AST::Sexp

# rubocop:disable Lint/InheritException
LoadError = Class.new(::LoadError)
# rubocop:enable Lint/InheritException

# Initialize object
#
Expand Down
4 changes: 2 additions & 2 deletions mutant.gemspec
Expand Up @@ -31,10 +31,10 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency('ice_nine', '~> 0.11.1')
gem.add_runtime_dependency('memoizable', '~> 0.4.2')
gem.add_runtime_dependency('mprelude', '~> 0.1.0')
gem.add_runtime_dependency('parser', '~> 2.6.5')
gem.add_runtime_dependency('parser', '~> 2.7.0.2')
gem.add_runtime_dependency('procto', '~> 0.0.2')
gem.add_runtime_dependency('unparser', '~> 0.4.6')

gem.add_development_dependency('devtools', '~> 0.1.23')
gem.add_development_dependency('devtools', '~> 0.1.25')
gem.add_development_dependency('parallel', '~> 1.3')
end

0 comments on commit 60f8c72

Please sign in to comment.