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

Refactor/bump deps #288

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
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 .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ Gemspec/RequireMFA:
Enabled: false

# A line length of 200 covers most violations in the repo while still being
# a more up to date length given today's screen sizes
# a more up-to-date length given today's screen sizes
Layout/LineLength:
Max: 200

# We want to permit Exception rescuing in these two instances as they literally guard against the final fail chance
Lint/RescueException:
Exclude:
- lib/cucumber/core/test/defined.rb
- lib/cucumber/core/test/action/defined.rb
- lib/cucumber/core/test/around_hook.rb

RSpec/ExampleLength:
Expand Down
39 changes: 2 additions & 37 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-12-24 10:12:07 UTC using RuboCop version 1.69.2.
# on 2025-01-07 14:30:00 UTC using RuboCop version 1.69.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# TODO: [LH] v13 Part 3 iteration -> 53 files inspected, 450 offenses detected, 173 offenses auto-correctable
# TODO: [LH] v13 -> 54 files inspected, 424 offenses detected, 133 offenses auto-correctable
# TODO: [LH] v13 -> 58 files inspected, 392 offenses detected, 100 offenses auto-correctable
# TODO: [LH] v14 Pre-release iteration -> 58 files inspected, 392 offenses detected, 100 offenses auto-correctable
# TODO: [LH] v14 Pre-release iteration 2 (Rubocop upgrade) -> 60 files inspected, 324 offenses detected, 86 offenses autocorrectable
# TODO: [LH] v14 Pre-release iteration 3 (Rubocop additional upgrade) -> 60 files inspected, 267 offenses detected, 26 offenses autocorrectable
# TODO: [LH] v15 Release incoming (Minimum ruby bump) -> 60 files inspected, 234 offenses detected, 12 offenses autocorrectable

# Offense count: 1
Lint/RescueException:
Exclude:
- 'lib/cucumber/core/test/action/defined.rb'
# TODO: [LH] v15.1 (Minor fixes) -> 60 files inspected, 239 offenses detected, 15 offenses autocorrectable

# Offense count: 1
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Expand Down Expand Up @@ -51,14 +44,6 @@ RSpec/EmptyExampleGroup:
RSpec/ExampleLength:
Max: 11

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: hash, symbol
RSpec/MetadataStyle:
Exclude:
- 'spec/cucumber/core/test/locations_filter_spec.rb'

# Offense count: 24
RSpec/MissingExampleGroupArgument:
Exclude:
Expand Down Expand Up @@ -117,12 +102,6 @@ Style/AccessModifierDeclarations:
Exclude:
- 'lib/cucumber/core/filter.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/ExpandPathArguments:
Exclude:
- 'Rakefile'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedMethods, AllowedPatterns.
Expand All @@ -139,12 +118,6 @@ Style/NumericPredicate:
- 'lib/cucumber/core/event.rb'
- 'lib/cucumber/core/test/result.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/PerlBackrefs:
Exclude:
- 'lib/cucumber/core/test/location.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowModifier.
Expand All @@ -159,11 +132,3 @@ Style/SuperWithArgsParentheses:
Exclude:
- 'lib/cucumber/core/test/doc_string.rb'
- 'lib/cucumber/core/test/location.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
# AllowedMethods: define_method
Style/SymbolProc:
Exclude:
- 'spec/cucumber/core/test/runner_spec.rb'
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CONTRIBUTING.md) for more info on how to contribute to Cucumber.

## [Unreleased]
### Changed
- Permit usage of gherkin up to v30

## [15.0.0] - 2024-12-24
### Changed
- Permit usage of gherkin up to v29 and messages up to v28
- Permit usage of messages up to v28

### Fixed
- References to the Time Conversion and UUID helpers needed altering to use the `Helpers` namespace
Expand All @@ -32,7 +34,7 @@ See upgrading notes for [14.0.0.md](upgrading_notes/14.0.0.md#upgrading-to-cucum

## [13.0.3] - 2024-07-24
### Changed
- Fixed up all remaining Layout auto-correct cops in the codebase
- Fixed up all remaining Layout autocorrect cops in the codebase

## [13.0.2] - 2024-03-21
### Changed
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require 'rubygems'
require 'bundler'
Bundler::GemHelper.install_tasks

$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift File.expand_path('lib', __dir__)

require 'rubocop/rake_task'
RuboCop::RakeTask.new
Expand Down
8 changes: 4 additions & 4 deletions cucumber-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ Gem::Specification.new do |s|
'funding_uri' => 'https://opencollective.com/cucumber'
}

s.add_dependency 'cucumber-gherkin', '> 27', '< 30'
s.add_dependency 'cucumber-messages', '> 25', '< 28'
s.add_dependency 'cucumber-gherkin', '> 27', '< 31'
s.add_dependency 'cucumber-messages', '> 26', '< 29'
s.add_dependency 'cucumber-tag-expressions', '> 5', '< 7'

s.add_development_dependency 'rake', '~> 13.2'
s.add_development_dependency 'rspec', '~> 3.13'
s.add_development_dependency 'rubocop', '~> 1.69.0'
s.add_development_dependency 'rubocop', '~> 1.69.2'
s.add_development_dependency 'rubocop-packaging', '~> 0.5.2'
s.add_development_dependency 'rubocop-rake', '~> 0.6.0'
s.add_development_dependency 'rubocop-rspec', '~> 3.0.5'
s.add_development_dependency 'rubocop-rspec', '~> 3.3.0'

s.files = Dir['CHANGELOG.md', 'README.md', 'LICENSE', 'lib/**/*']
s.rdoc_options = ['--charset=UTF-8']
Expand Down
12 changes: 6 additions & 6 deletions lib/cucumber/core/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ def create_test_case(pickle)
location = location_from_pickle(pickle)
parent_locations = parent_locations_from_pickle(pickle)
tags = tags_from_pickle(pickle, uri)
test_case = Test::Case.new(id_generator.new_id, pickle.name, test_steps, location, parent_locations, tags, pickle.language)
@event_bus&.test_case_created(test_case, pickle)
test_case
Test::Case.new(id_generator.new_id, pickle.name, test_steps, location, parent_locations, tags, pickle.language).tap do |test_case|
@event_bus&.test_case_created(test_case, pickle)
end
end

def create_test_step(pickle_step, uri)
location = location_from_pickle_step(pickle_step, uri)
multiline_arg = create_multiline_arg(pickle_step, uri)
step = Test::Step.new(id_generator.new_id, pickle_step.text, location, multiline_arg)
@event_bus&.test_step_created(step, pickle_step)
step
Test::Step.new(id_generator.new_id, pickle_step.text, location, multiline_arg).tap do |test_step|
@event_bus&.test_step_created(test_step, pickle_step)
end
end

def create_multiline_arg(pickle_step, _uri)
Expand Down
4 changes: 1 addition & 3 deletions lib/cucumber/core/test/doc_string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ def lines_count
end

def ==(other)
if other.respond_to?(:content_type)
return false unless content_type == other.content_type
end
return false if other.respond_to?(:content_type) && content_type != other.content_type
return content == other.to_str if other.respond_to?(:to_str)

false
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/core/test/location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def self.from_source_location(file, line)
if file.index(pwd)
file = file[pwd.length + 1..]
elsif file =~ /.*\/gems\/(.*\.rb)$/
file = $1
file = Regexp.last_match(1)
end
new(file, line)
end
Expand Down
4 changes: 1 addition & 3 deletions lib/cucumber/core/test/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,7 @@ def respond_to_missing?(*)

def ok?(strict: StrictConfiguration.new)
TYPES.each do |type|
if get_total(type) > 0
return false unless Result.ok?(type, strict: strict)
end
return false if get_total(type).positive? && !Result.ok?(type, strict: strict)
end
true
end
Expand Down
6 changes: 2 additions & 4 deletions spec/cucumber/core/filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@

context 'when customizing using a subclass' do
let(:basic_blanking_filter) do
# Each filter implicitly gets a :receiver attribute
# that you need to call with the new test case
# Each filter implicitly gets a :receiver attribute that you need to call with the new test case
# once you've received yours and modified it.

Class.new(described_class.new) do
Expand All @@ -49,8 +48,7 @@ def test_case(test_case)
end

let(:named_blanking_filter) do
# You can pass the names of attributes when building a
# filter, allowing you to have custom attributes.
# You can pass the names of attributes when building a filter, allowing you to have custom attributes.

Class.new(described_class.new(:name_pattern)) do
def test_case(test_case)
Expand Down
2 changes: 1 addition & 1 deletion spec/cucumber/core/test/action/defined_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require 'cucumber/core/test/action'
require 'cucumber/core/test/duration_matcher'
require 'support/duration_matcher'

describe Cucumber::Core::Test::Action::Defined do
it 'requires a block' do
Expand Down
2 changes: 1 addition & 1 deletion spec/cucumber/core/test/action/undefined_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require 'cucumber/core/test/action'
require 'cucumber/core/test/duration_matcher'
require 'support/duration_matcher'

describe Cucumber::Core::Test::Action::Undefined do
let(:location) { double }
Expand Down
2 changes: 1 addition & 1 deletion spec/cucumber/core/test/locations_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def test_case_named(name)
end
end

context 'when under extreme load', slow: true do
context 'when under extreme load', :slow do
num_features = 50
num_scenarios_per_feature = 50

Expand Down
2 changes: 1 addition & 1 deletion spec/cucumber/core/test/result_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require 'cucumber/core/test/result'
require 'cucumber/core/test/duration_matcher'
require 'support/duration_matcher'

module Cucumber
module Core
Expand Down
Loading
Loading