Skip to content

Commit c10327a

Browse files
authored
Refactor/manual cleanup part2 (#1740)
* Remove bespoke JRuby support for something we're deprecating * Remove edge case JRuby fringe unicode test - cck handles things like this better * Remove redundant cucumber.yml config * Delete some ancient testing examples no longer relevant * Begin simplifying deprecator * Remove some initial customisation about raising deprecations * Ensure to set all args at all times when deprecating * Unpick flaky errors * Remove redundant test that shows the situation being faiing in tests no longer required * Remove redundant colour / cleanup overrides for colouring warnings * Remove secondary module and just directly call * Add changelog entry * Fix Lint/SupressedException * partial fix for cyclomatic score in JSONWorld * Partial fix for cyclomatic score in ASTLookup * Use cleaner begin/rescue/end * Add changelog entry for removal of sample projects * Fix up some readme styling * Fix erroneous badges for readme * Regenerate the auto-gen-config for rubocop after removing some redundant parts of original config * Sticking-patch for the situation where rubocop doesn't like conflicting numbers * Add in inherit mode config
1 parent 8e519a5 commit c10327a

File tree

27 files changed

+110
-341
lines changed

27 files changed

+110
-341
lines changed

.rubocop.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
inherit_from: .rubocop_todo.yml
22

3+
inherit_mode:
4+
merge:
5+
- Exclude
6+
37
require:
48
- rubocop-capybara
59
- rubocop-packaging
@@ -20,11 +24,6 @@ AllCops:
2024
- 'temp_app/**/*'
2125
- 'cck/features/**/*'
2226

23-
# TODO: [LH] - Candidate for phasing out in v9 patch releases. People should have this stored in editor and ideally not use windows
24-
# for ruby development. Where they are, their editor config should have this setting
25-
Layout/EndOfLine:
26-
EnforcedStyle: lf
27-
2827
# 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
2928
Layout/LineLength:
3029
Max: 200
@@ -36,13 +35,6 @@ Layout/TrailingWhitespace:
3635
- 'spec/cucumber/formatter/pretty_spec.rb'
3736
- 'spec/cucumber/formatter/progress_spec.rb'
3837

39-
# TODO: [LH] - This needs re-reviewing and fixing, we have been partially fixing this up in 2019/2020 onwards
40-
# (Likely that this is primarily already fixed)
41-
# Reviewed: please see PR-1022 for details on why this cop is disabled:
42-
# https://github.com/cucumber/cucumber-ruby/pull/1022
43-
Lint/AmbiguousOperator:
44-
Enabled: false
45-
4638
# TODO: [LH] - This needs a re-review. I think we can pretty much delete / phase this out with incremental updates
4739
# We exclude proto_world for documentation (rdoc) purpose
4840
Lint/UselessMethodDefinition:
@@ -58,6 +50,7 @@ Metrics/AbcSize:
5850
Exclude:
5951
- lib/cucumber/formatter/junit.rb
6052
- spec/cucumber/formatter/http_io_spec.rb
53+
- lib/cucumber/glue/proto_world.rb
6154

6255
# TODO: [LH] - This needs a re-review. I think we can pretty much delete / phase this out with incremental updates
6356
Metrics/BlockLength:
@@ -93,6 +86,7 @@ Metrics/MethodLength:
9386
- lib/cucumber/cli/options.rb
9487
- lib/cucumber/formatter/publish_banner_printer.rb
9588
- spec/cucumber/formatter/http_io_spec.rb
89+
- lib/cucumber/glue/proto_world.rb
9690

9791
# Rubocop doesn't like method names in other languages but as Cucumber supports
9892
# languages, this cop needs to be disabled.

.rubocop_todo.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2023-09-12 16:42:15 UTC using RuboCop version 1.56.3.
3+
# on 2023-10-02 12:57:00 UTC using RuboCop version 1.56.3.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -9,6 +9,8 @@
99
# TODO - [LH] -> Aug '23 - 370 files inspected, 1110 offenses detected, 482 offenses autocorrectable
1010
# TODO - [LH] -> Sep 6 '23 - 370 files inspected, 983 offenses detected, 368 offenses autocorrectable
1111
# TODO - [LH] -> Sep 11 '23 - 370 files inspected, 825 offenses detected, 387 offenses autocorrectable
12+
# TODO - [LH] -> Sep 19 '23 - 370 files inspected, 640 offenses detected, 202 offenses autocorrectable
13+
# TODO - [LH] -> Oct '23 - 355 files inspected, 642 offenses detected, 205 offenses autocorrectable
1214

1315
# Offense count: 1
1416
# This cop supports safe autocorrection (--autocorrect).
@@ -67,24 +69,41 @@ Layout/IndentationWidth:
6769
Exclude:
6870
- 'spec/cucumber/formatter/fail_fast_spec.rb'
6971

72+
# Offense count: 3
73+
# This cop supports safe autocorrection (--autocorrect).
74+
Lint/AmbiguousOperator:
75+
Exclude:
76+
- 'lib/cucumber/multiline_argument/data_table.rb'
77+
- 'lib/cucumber/running_test_case.rb'
78+
- 'spec/cucumber/formatter/spec_helper.rb'
79+
7080
# Offense count: 1
7181
# This cop supports safe autocorrection (--autocorrect).
7282
Lint/RedundantCopDisableDirective:
7383
Exclude:
7484
- 'lib/cucumber/cli/options.rb'
7585

7686
# Offense count: 1
77-
# Configuration parameters: AllowComments, AllowNil.
78-
Lint/SuppressedException:
87+
Lint/RescueException:
7988
Exclude:
80-
- 'lib/cucumber/rake/task.rb'
89+
- 'lib/cucumber/glue/proto_world.rb'
8190

82-
# Offense count: 9
91+
# Offense count: 1
92+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
93+
Metrics/AbcSize:
94+
Max: 50
95+
96+
# Offense count: 8
8397
# Configuration parameters: AllowedMethods, AllowedPatterns.
8498
Metrics/CyclomaticComplexity:
8599
Max: 12
86100

87-
# Offense count: 9
101+
# Offense count: 1
102+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
103+
Metrics/MethodLength:
104+
Max: 57
105+
106+
# Offense count: 7
88107
# Configuration parameters: AllowedMethods, AllowedPatterns.
89108
Metrics/PerceivedComplexity:
90109
Max: 13
@@ -159,7 +178,7 @@ RSpec/EmptyLineAfterFinalLet:
159178
- 'spec/cucumber/configuration_spec.rb'
160179
- 'spec/cucumber/hooks_spec.rb'
161180

162-
# Offense count: 101
181+
# Offense count: 100
163182
# Configuration parameters: CountAsOne.
164183
RSpec/ExampleLength:
165184
Max: 58
@@ -204,7 +223,7 @@ RSpec/InstanceVariable:
204223
Exclude:
205224
- 'spec/cucumber/formatter/http_io_spec.rb'
206225

207-
# Offense count: 6
226+
# Offense count: 5
208227
# Configuration parameters: EnforcedStyle.
209228
# SupportedStyles: have_received, receive
210229
RSpec/MessageSpies:

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
99
Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CONTRIBUTING.md) for more info on how to contribute to Cucumber.
1010

1111
## [Unreleased]
12+
### Changed
13+
- First couple of passes of tidying up approximately 30% of the manual fix cops
14+
([#1739](https://github.com/cucumber/cucumber-ruby/pull/1739) [#1740](https://github.com/cucumber/cucumber-ruby/pull/1740) [luke-hill](https://github.com/luke-hill))
15+
- Removed a bunch of example files / sample projects from ancient projects no longer viable
16+
[#1740](https://github.com/cucumber/cucumber-ruby/pull/1740) [luke-hill](https://github.com/luke-hill))
1217

1318
## [9.0.2] - 2023-09-11
1419
### Changed

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://vshymanskyy.github.io/StandWithUkraine)
66
[![OpenCollective](https://opencollective.com/cucumber/backers/badge.svg)](https://opencollective.com/cucumber)
77
[![OpenCollective](https://opencollective.com/cucumber/sponsors/badge.svg)](https://opencollective.com/cucumber)
8-
[![pull requests](https://oselvar.com/api/badge?label=pull%20requests&csvUrl=https%3A%2F%2Fraw.githubusercontent.com%2Fcucumber%2Foselvar-github-metrics%2Fmain%2Fdata%2Fcucumber%2Fcucumber-ruby%2FpullRequests.csv)](https://oselvar.com/github/cucumber/oselvar-github-metrics/main/cucumber/cucumber-ruby)
9-
[![issues](https://oselvar.com/api/badge?label=issues&csvUrl=https%3A%2F%2Fraw.githubusercontent.com%2Fcucumber%2Foselvar-github-metrics%2Fmain%2Fdata%2Fcucumber%2Fcucumber-ruby%2Fissues.csv)](https://oselvar.com/github/cucumber/oselvar-github-metrics/main/cucumber/cucumber-ruby)
10-
[![Test cucumber](https://github.com/cucumber/cucumber-ruby/actions/workflows/cucumber-ruby.yml/badge.svg)](https://github.com/cucumber/cucumber-ruby/actions/workflows/cucumber-ruby.yml)
8+
[![Test cucumber](https://github.com/cucumber/cucumber-ruby/actions/workflows/test.yaml/badge.svg)](https://github.com/cucumber/cucumber-ruby/actions/workflows/test.yaml)
119
[![Code Climate](https://codeclimate.com/github/cucumber/cucumber-ruby.svg)](https://codeclimate.com/github/cucumber/cucumber-ruby)
1210
[![Coverage Status](https://coveralls.io/repos/cucumber/cucumber-ruby/badge.svg?branch=main)](https://coveralls.io/r/cucumber/cucumber-ruby?branch=main)
1311

@@ -56,8 +54,7 @@ Later in this document, bundler is considered being used so all commands are usi
5654

5755
### Ruby on Rails
5856

59-
Using Ruby on Rails? You can use [cucumber-rails](https://github.com/cucumber/cucumber-rails)
60-
to bring Cucumber into your Rails project.
57+
Using Ruby on Rails? You can use [cucumber-rails](https://github.com/cucumber/cucumber-rails) to bring Cucumber into your Rails project.
6158

6259
## Usage
6360

@@ -133,16 +130,15 @@ To execute a single example, indicates the line of the name of the example:
133130

134131
$ bundle exec cucumber features/rule.feature:5
135132

136-
To summarize the results on the standard output, and writte a HTML report on disk:
133+
To summarize the results on the standard output, and generate a HTML report on disk:
137134

138135
$ bundle exec cucumber --format summary --format html --out report.html
139136

140137
For more command line options
141138

142139
$ bundle exec cucumber --help
143140

144-
You can also find documentation on the command line possibilities in
145-
[features/docs/cli](features/docs/cli).
141+
You can also find documentation on the command line possibilities in [features/docs/cli](features/docs/cli).
146142

147143
## Documentation and support
148144

cucumber.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ end
1212
%>
1313
default: <%= std_opts %> --tags "not @jruby"
1414
jruby: <%= std_opts %>
15-
jruby_win: <%= std_opts %> CUCUMBER_FORWARD_SLASH_PATHS=true
16-
windows_mri: <%= std_opts %> --tags "not @jruby" --tags "not @needs-many-fonts" --tags "not @todo-windows" CUCUMBER_FORWARD_SLASH_PATHS=true
15+
jruby_win: <%= std_opts %>
16+
windows_mri: <%= std_opts %> --tags "not @jruby" --tags "not @needs-many-fonts"
1717
wip: --wip <%= wip_opts %> features
1818
none: --format pretty

examples/rspec_doubles/Rakefile

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/rspec_doubles/features/mocking.feature

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/rspec_doubles/features/step_definitions/calvin_steps.rb

Lines changed: 0 additions & 21 deletions
This file was deleted.

examples/rspec_doubles/features/support/env.rb

Lines changed: 0 additions & 14 deletions
This file was deleted.

examples/tcl/README.textile

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)