Skip to content

Commit 7b71106

Browse files
authored
Add rubocop rules that weren't configured (#4323)
* Add/update rubocop rules that don't require code changes * Enable style/comparablebetween
1 parent b9c9a7e commit 7b71106

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.rubocop_cc.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Cloud Controller Specific Rubocop Config
22

3-
require:
3+
plugins:
44
- rubocop-sequel
55
- rubocop-rails
66
- rubocop-capybara
77
- rubocop-factory_bot
88
- rubocop-rspec
99
- rubocop-rspec_rails
10+
11+
require:
1012
- ./spec/linters/migration/add_constraint_name.rb
1113
- ./spec/linters/migration/include_string_size.rb
1214
- ./spec/linters/migration/require_primary_key.rb
@@ -160,10 +162,14 @@ Lint/AmbiguousOperatorPrecedence:
160162
Enabled: true
161163
Lint/AmbiguousRange:
162164
Enabled: true
165+
Lint/ArrayLiteralInRegexp:
166+
Enabled: true
163167
Lint/ConstantOverwrittenInRescue:
164168
Enabled: true
165169
Lint/ConstantReassignment:
166170
Enabled: true
171+
Lint/CopDirectiveSyntax:
172+
Enabled: true
167173
Lint/DeprecatedConstants:
168174
Enabled: true
169175
Lint/DuplicateBranch:
@@ -208,6 +214,8 @@ Lint/RedundantDirGlobSort:
208214
Enabled: true
209215
Lint/RedundantRegexpQuantifiers:
210216
Enabled: true
217+
Lint/RedundantTypeConversion:
218+
Enabled: true
211219
Lint/RefinementImportMethods:
212220
Enabled: true
213221
Lint/RequireRangeParentheses:
@@ -216,6 +224,8 @@ Lint/RequireRelativeSelfPath:
216224
Enabled: true
217225
Lint/SharedMutableDefault:
218226
Enabled: true
227+
Lint/SuppressedExceptionInNumberConversion:
228+
Enabled: true
219229
Lint/SymbolConversion:
220230
Enabled: true
221231
Lint/ToEnumArguments:
@@ -254,6 +264,8 @@ Style/CollectionCompact:
254264
Enabled: true
255265
Style/CombinableDefined:
256266
Enabled: true
267+
Style/ComparableBetween:
268+
Enabled: true
257269
Style/ComparableClamp:
258270
Enabled: true
259271
Style/ConcatArrayLiterals:
@@ -290,12 +302,16 @@ Style/HashConversion:
290302
Enabled: true
291303
Style/HashExcept:
292304
Enabled: true
305+
Style/HashFetchChain:
306+
Enabled: true
293307
Style/IfWithBooleanLiteralBranches:
294308
Enabled: true
295309
Style/InPatternThen:
296310
Enabled: true
297311
Style/ItAssignment:
298312
Enabled: true
313+
Style/ItBlockParameter:
314+
Enabled: true
299315
Style/KeywordArgumentsMerging:
300316
Enabled: true
301317
Style/MagicCommentFormat:
@@ -342,6 +358,8 @@ Style/RedundantEach:
342358
Enabled: true
343359
Style/RedundantFilterChain:
344360
Enabled: true
361+
Style/RedundantFormat:
362+
Enabled: true
345363
Style/RedundantHeredocDelimiterQuotes:
346364
Enabled: true
347365
Style/RedundantInitialize:
@@ -424,6 +442,8 @@ Rails/MatchRoute:
424442
Enabled: true
425443
Rails/MigrationClassName:
426444
Enabled: true
445+
Rails/MultipleRoutePaths:
446+
Enabled: true
427447
Rails/NegateInclude:
428448
Enabled: true
429449
Rails/Pluck:
@@ -454,6 +474,8 @@ Rails/SquishedSQLHeredocs:
454474
Enabled: true
455475
Rails/StripHeredoc:
456476
Enabled: true
477+
Rails/StrongParametersExpect:
478+
Enabled: true
457479
Rails/ThreeStateBooleanColumn:
458480
Enabled: true
459481
Rails/TimeZoneAssignment:
@@ -482,10 +504,14 @@ Rails/WhereNotWithMultipleConditions:
482504
Enabled: true
483505
Capybara/ClickLinkOrButtonStyle:
484506
Enabled: false
507+
Capybara/FindAllFirst:
508+
Enabled: true
485509
Capybara/MatchStyle:
486510
Enabled: false
487511
Capybara/NegationMatcher:
488512
Enabled: false
513+
Capybara/NegationMatcherAfterVisit:
514+
Enabled: true
489515
Capybara/RedundantWithinFind:
490516
Enabled: true
491517
Capybara/SpecificActions:

app/presenters/error_presenter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def initialize(error, test_mode=false, error_hasher=V2ErrorHasher.new(error))
88
end
99

1010
def client_error?
11-
response_code >= 400 && response_code <= 499
11+
response_code.between?(400, 499)
1212
end
1313

1414
def log_message

0 commit comments

Comments
 (0)