Skip to content

Commit 8faa2f1

Browse files
authored
Merge pull request rspec#296 from rspec/rubocop-update
Update base RuboCop conf to support Ruby 2.4-3.x
2 parents a350ce9 + f43d692 commit 8faa2f1

File tree

1 file changed

+45
-38
lines changed

1 file changed

+45
-38
lines changed

ci/.rubocop_rspec_base.yml

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,73 @@
11
# This file contains defaults for RSpec projects. Individual projects
22
# can customize by inheriting this file and overriding particular settings.
33

4-
AccessModifierIndentation:
4+
Layout/AccessModifierIndentation:
55
Enabled: false
66

77
# "Use alias_method instead of alias"
88
# We're fine with `alias`.
9-
Alias:
9+
Style/Alias:
1010
Enabled: false
1111

12-
AlignParameters:
13-
EnforcedStyle: with_first_parameter
14-
1512
# "Avoid the use of the case equality operator ==="
1613
# We prefer using `Class#===` over `Object#is_a?` because `Class#===`
1714
# is less likely to be monkey patched than `is_a?` on a user object.
18-
CaseEquality:
15+
Style/CaseEquality:
1916
Enabled: false
2017

2118
# Warns when the class is excessively long.
22-
ClassLength:
19+
Metrics/ClassLength:
2320
Max: 100
2421

25-
CollectionMethods:
22+
Style/CollectionMethods:
2623
PreferredMethods:
2724
reduce: 'inject'
2825

2926
# Over time we'd like to get this down, but this is what we're at now.
30-
CyclomaticComplexity:
27+
Metrics/CyclomaticComplexity:
3128
Max: 10
3229

3330
# We use YARD to enforce documentation. It works better than rubocop's
3431
# enforcement...rubocop complains about the places we re-open
3532
# `RSpec::Expectations` and `RSpec::Matchers` w/o having doc commments.
36-
Documentation:
33+
Style/Documentation:
3734
Enabled: false
3835

3936
# We still support 1.8.7 which requires trailing dots
40-
DotPosition:
37+
Layout/DotPosition:
4138
EnforcedStyle: trailing
4239

43-
DoubleNegation:
40+
Style/DoubleNegation:
4441
Enabled: false
4542

4643
# each_with_object is unavailable on 1.8.7 so we have to disable this one.
47-
EachWithObject:
44+
Style/EachWithObject:
4845
Enabled: false
4946

50-
FormatString:
47+
Style/FormatString:
5148
EnforcedStyle: percent
5249

5350
# As long as we support ruby 1.8.7 we have to use hash rockets.
54-
HashSyntax:
51+
Style/HashSyntax:
5552
EnforcedStyle: hash_rockets
5653

5754
# We can't use the new lambda syntax, since we still support 1.8.7.
58-
Lambda:
55+
Style/Lambda:
5956
Enabled: false
6057

6158
# Over time we'd like to get this down, but this is what we're at now.
62-
LineLength:
59+
Layout/LineLength:
6360
Max: 100
6461

6562
# Over time we'd like to get this down, but this is what we're at now.
66-
MethodLength:
63+
Metrics/MethodLength:
6764
Max: 15
6865

6966
# Who cares what we call the argument for binary operator methods?
70-
BinaryOperatorParameterName:
67+
Naming/BinaryOperatorParameterName:
7168
Enabled: false
7269

73-
PercentLiteralDelimiters:
70+
Style/PercentLiteralDelimiters:
7471
PreferredDelimiters:
7572
'%': () # double-quoted string
7673
'%i': '[]' # array of symbols
@@ -84,41 +81,44 @@ PercentLiteralDelimiters:
8481

8582
# We have too many special cases where we allow generator methods or prefer a
8683
# prefixed predicate due to it's improved readability.
87-
PredicateName:
84+
Naming/PredicateName:
8885
Enabled: false
8986

9087
# On 1.8 `proc` is `lambda`, so we use `Proc.new` to ensure we get real procs on all supported versions.
9188
# http://batsov.com/articles/2014/02/04/the-elements-of-style-in-ruby-number-12-proc-vs-proc-dot-new/
92-
Proc:
89+
Style/Proc:
9390
Enabled: false
9491

9592
# Exceptions should be rescued with `Support::AllExceptionsExceptOnesWeMustNotRescue`
96-
RescueException:
93+
Lint/RescueException:
9794
Enabled: true
9895

9996
# We haven't adopted the `fail` to signal exceptions vs `raise` for re-raises convention.
100-
SignalException:
97+
Style/SignalException:
10198
Enabled: false
10299

103100
# We've tended to use no space, so it's less of a change to stick with that.
104-
SpaceAroundEqualsInParameterDefault:
101+
Layout/SpaceAroundEqualsInParameterDefault:
105102
EnforcedStyle: no_space
106103

107104
# We don't care about single vs double qoutes.
108-
StringLiterals:
105+
Style/StringLiterals:
109106
Enabled: false
110107

111108
# This rule favors constant names from the English standard library which we don't load.
112109
Style/SpecialGlobalVars:
113110
Enabled: false
114111

115-
Style/TrailingCommaInLiteral:
112+
Style/TrailingCommaInArrayLiteral:
113+
Enabled: false
114+
115+
Style/TrailingCommaInHashLiteral:
116116
Enabled: false
117117

118118
Style/TrailingCommaInArguments:
119119
Enabled: false
120120

121-
TrivialAccessors:
121+
Style/TrivialAccessors:
122122
AllowDSLWriters: true
123123
AllowPredicates: true
124124
ExactNameMatch: true
@@ -132,6 +132,15 @@ Layout/EmptyLineBetweenDefs:
132132
Layout/FirstParameterIndentation:
133133
Enabled: false
134134

135+
Layout/ParameterAlignment:
136+
EnforcedStyle: with_first_parameter
137+
138+
Layout/SpaceInsideBlockBraces:
139+
Enabled: false
140+
141+
Layout/SpaceInsideParens:
142+
Enabled: false
143+
135144
Naming/ConstantName:
136145
Enabled: false
137146

@@ -159,7 +168,10 @@ Style/IfUnlessModifier:
159168
Style/IfUnlessModifierOfIfUnless:
160169
Enabled: false
161170

162-
Style/MethodMissing:
171+
Lint/MissingSuper:
172+
Enabled: false
173+
174+
Style/MissingRespondToMissing:
163175
Enabled: false
164176

165177
Style/MixinUsage:
@@ -240,24 +252,19 @@ Style/StderrPuts:
240252
Style/TernaryParentheses:
241253
Enabled: false
242254

243-
# This could likely be enabled, but it had a false positive on rspec-mocks
244-
# (suggested change was not behaviour preserving) so I don't trust it.
245-
Performance/HashEachMethods:
246-
Enabled: false
247-
248255
Naming/HeredocDelimiterNaming:
249256
Enabled: false
250257

251-
Layout/EmptyLineAfterMagicComment:
258+
Layout/AssignmentIndentation:
252259
Enabled: false
253260

254-
Layout/IndentArray:
261+
Layout/EmptyLineAfterMagicComment:
255262
Enabled: false
256263

257-
Layout/IndentAssignment:
264+
Layout/FirstArrayElementIndentation:
258265
Enabled: false
259266

260-
Layout/IndentHeredoc:
267+
Layout/HeredocIndentation:
261268
Enabled: false
262269

263270
Layout/SpaceInsidePercentLiteralDelimiters:

0 commit comments

Comments
 (0)