Skip to content

Commit a7457dd

Browse files
committed
Disable strict cops and fix other violations
1 parent 2819a44 commit a7457dd

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

.rubocop.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Encoding:
1414
Exclude:
1515
- lib/rspec/core/formatters/exception_presenter.rb
1616

17+
# This should go down over time.
18+
Metrics/AbcSize:
19+
Max: 40
20+
1721
# This should go down over time.
1822
Metrics/LineLength:
1923
Max: 130
@@ -26,6 +30,9 @@ Metrics/MethodLength:
2630
Metrics/CyclomaticComplexity:
2731
Max: 12
2832

33+
Metrics/PerceivedComplexity:
34+
Max: 15
35+
2936
Lint/HandleExceptions:
3037
Exclude:
3138
- lib/rspec/core/example.rb
@@ -53,14 +60,21 @@ Style/SpaceAroundOperators:
5360
- '==='
5461
- '=>'
5562
- '<<'
63+
- '||'
5664

5765
Style/AccessModifierIndentation:
5866
Enabled: false
5967

68+
Style/RegexpLiteral:
69+
Enabled: false
70+
6071
# This could change depending of the style used
6172
Style/MultilineOperationIndentation:
6273
Enabled: false
6374

75+
Style/BarePercentLiterals:
76+
Enabled: false
77+
6478
# Exclude the default spec_helper to make it easier to uncomment out
6579
# default settings (for both users and the Cucumber suite).
6680
Style/BlockComments:

lib/rspec/core/configuration.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def mock_with(framework)
580580
end
581581

582582
new_name, old_name = [framework_module, @mock_framework].map do |mod|
583-
mod.respond_to?(:framework_name) ? mod.framework_name : :unnamed
583+
mod.respond_to?(:framework_name) ? mod.framework_name : :unnamed
584584
end
585585

586586
unless new_name == old_name
@@ -1731,7 +1731,8 @@ def extract_location(path)
17311731

17321732
if match
17331733
captures = match.captures
1734-
path, lines = captures[0], captures[1][1..-1].split(":").map { |n| n.to_i }
1734+
path = captures[0]
1735+
lines = captures[1][1..-1].split(":").map(&:to_i)
17351736
filter_manager.add_location path, lines
17361737
else
17371738
path, scoped_ids = Example.parse_id(path)

lib/rspec/core/configuration_options.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def force?(key)
6464
end
6565

6666
def order(keys)
67-
OPTIONS_ORDER.reverse.each do |key|
67+
OPTIONS_ORDER.reverse_each do |key|
6868
keys.unshift(key) if keys.delete(key)
6969
end
7070
keys

lib/rspec/core/notifications.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module Notifications
1010
# @private
1111
module NullColorizer
1212
module_function
13+
1314
def wrap(line, _code_or_symbol)
1415
line
1516
end

lib/rspec/core/option_parser.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ def parser(options)
252252
raise OptionParser::InvalidOption.new
253253
end
254254
end
255-
256255
end
257256
end
258257
# rubocop:enable Metrics/AbcSize

0 commit comments

Comments
 (0)