Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 0953e54

Browse files
benoittgtJonRowe
authored andcommitted
Fix #233 conflicts -> Update rubocop (#350)
Updated rubocop rules see: #350
1 parent 396000d commit 0953e54

File tree

7 files changed

+16
-11
lines changed

7 files changed

+16
-11
lines changed

.rubocop.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,11 @@ Lint/AssignmentInCondition:
2323
Exclude:
2424
# The pattern makes sense here
2525
- 'lib/rspec/support/mutex.rb'
26+
27+
# Over time we'd like to get this down, but this is what we're at now.
28+
Metrics/AbcSize:
29+
Max: 22
30+
31+
# Over time we'd like to get this down, but this is what we're at now.
32+
Metrics/PerceivedComplexity:
33+
Max: 9

lib/rspec/support/caller_filter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def self.first_non_rspec_line(skip_frames=3, increment=5)
6969
return line.to_s if line
7070

7171
skip_frames += increment
72-
increment *= 2 # The choice of two here is arbitrary.
72+
increment *= 2 # The choice of two here is arbitrary.
7373
end
7474
end
7575
else

lib/rspec/support/comparable_version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def initialize(string)
1010
@string = string
1111
end
1212

13-
def <=>(other)
13+
def <=>(other) # rubocop:disable Metrics/AbcSize
1414
other = self.class.new(other) unless other.is_a?(self.class)
1515

1616
return 0 if string == other.string

lib/rspec/support/method_signature_verifier.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def classify_parameters
122122
end
123123
end
124124

125-
@max_non_kw_args = @min_non_kw_args + optional_non_kw_args
125+
@max_non_kw_args = @min_non_kw_args + optional_non_kw_args
126126
@allowed_kw_args = @required_kw_args + @optional_kw_args
127127
end
128128
else
@@ -285,7 +285,7 @@ def initialize(signature, args=[])
285285
@arbitrary_kw_args = @unlimited_args = false
286286
end
287287

288-
def with_expectation(expectation) # rubocop:disable MethodLength
288+
def with_expectation(expectation) # rubocop:disable MethodLength, Metrics/PerceivedComplexity
289289
return self unless MethodSignatureExpectation === expectation
290290

291291
if expectation.empty?

lib/rspec/support/ruby_features.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Support
77
#
88
# Provides query methods for different OS or OS features.
99
module OS
10-
module_function
10+
module_function
1111

1212
def windows?
1313
!!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/)
@@ -22,7 +22,7 @@ def windows_file_path?
2222
#
2323
# Provides query methods for different rubies
2424
module Ruby
25-
module_function
25+
module_function
2626

2727
def jruby?
2828
RUBY_PLATFORM == 'java'
@@ -58,7 +58,7 @@ def truffleruby?
5858
# Provides query methods for ruby features that differ among
5959
# implementations.
6060
module RubyFeatures
61-
module_function
61+
module_function
6262

6363
if Ruby.jruby?
6464
# On JRuby 1.7 `--1.8` mode, `Process.respond_to?(:fork)` returns true,

lib/rspec/support/spec/in_sub_process.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ module InSubProcess
77

88
# Useful as a way to isolate a global change to a subprocess.
99

10-
# rubocop:disable MethodLength
11-
def in_sub_process(prevent_warnings=true)
10+
def in_sub_process(prevent_warnings=true) # rubocop:disable MethodLength, Metrics/AbcSize
1211
exception_reader, exception_writer = IO.pipe
1312
result_reader, result_writer = IO.pipe
1413

@@ -46,7 +45,6 @@ def in_sub_process(prevent_warnings=true)
4645
result_reader.close
4746
result
4847
end
49-
# rubocop:enable MethodLength
5048
alias :in_sub_process_if_possible :in_sub_process
5149

5250
def marshal_dump_with_unmarshable_object_handling(object)

lib/rspec/support/spec/string_matcher.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# which also relies on EncodedString. Instead, confirm the
55
# strings have the same bytes.
66
RSpec::Matchers.define :be_identical_string do |expected|
7-
87
if String.method_defined?(:encoding)
98
match do
109
expected_encoding? &&

0 commit comments

Comments
 (0)