Skip to content

Commit 807a6ec

Browse files
committed
Enable more cops
1 parent aa3884c commit 807a6ec

File tree

3 files changed

+80
-50
lines changed

3 files changed

+80
-50
lines changed

.rubocop.yml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,14 @@
11
inherit_from: .rubocop_todo.yml
22

3+
require:
4+
- rubocop-minitest
5+
- rubocop-performance
6+
- rubocop-rake
7+
38
AllCops:
49
TargetRubyVersion: 2.6
5-
NewCops: disable
10+
NewCops: enable
611
Include:
712
- 'lib/**/*'
813
Exclude:
914
- '**/*.xsd'
10-
11-
#Bundler:
12-
# Enabled: false
13-
#
14-
#Gemspec:
15-
# Enabled: false
16-
#
17-
#Layout:
18-
# Enabled: false
19-
#
20-
#Lint:
21-
# Enabled: false
22-
#
23-
#Metrics:
24-
# Enabled: false
25-
#
26-
#Naming:
27-
# Enabled: false
28-
#
29-
#Security:
30-
# Enabled: true
31-
#
32-
#Style:
33-
# Enabled: false

.rubocop_todo.yml

Lines changed: 73 additions & 24 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-03-08 07:33:39 UTC using RuboCop version 1.45.1.
3+
# on 2023-03-08 07:46:47 UTC using RuboCop version 1.45.1.
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
@@ -22,13 +22,12 @@ Layout/ClosingParenthesisIndentation:
2222
- 'lib/onelogin/ruby-saml/response.rb'
2323
- 'lib/xml_security.rb'
2424

25-
# Offense count: 7
25+
# Offense count: 1
2626
# This cop supports safe autocorrection (--autocorrect).
2727
# Configuration parameters: AllowForAlignment.
2828
Layout/CommentIndentation:
2929
Exclude:
3030
- 'lib/onelogin/ruby-saml/logoutresponse.rb'
31-
- 'lib/xml_security.rb'
3231

3332
# Offense count: 11
3433
# This cop supports safe autocorrection (--autocorrect).
@@ -135,18 +134,6 @@ Layout/FirstHashElementIndentation:
135134
- 'lib/onelogin/ruby-saml/authrequest.rb'
136135
- 'lib/onelogin/ruby-saml/metadata.rb'
137136

138-
# Offense count: 40
139-
# This cop supports safe autocorrection (--autocorrect).
140-
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
141-
# SupportedHashRocketStyles: key, separator, table
142-
# SupportedColonStyles: key, separator, table
143-
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
144-
Layout/HashAlignment:
145-
Exclude:
146-
- 'lib/onelogin/ruby-saml/logoutresponse.rb'
147-
- 'lib/onelogin/ruby-saml/settings.rb'
148-
- 'lib/onelogin/ruby-saml/slo_logoutrequest.rb'
149-
150137
# Offense count: 1
151138
# This cop supports safe autocorrection (--autocorrect).
152139
# Configuration parameters: EnforcedStyle.
@@ -280,6 +267,13 @@ Layout/TrailingWhitespace:
280267
- 'lib/onelogin/ruby-saml/attributes.rb'
281268
- 'lib/onelogin/ruby-saml/idp_metadata_parser.rb'
282269

270+
# Offense count: 3
271+
# This cop supports safe autocorrection (--autocorrect).
272+
Lint/AmbiguousOperatorPrecedence:
273+
Exclude:
274+
- 'lib/onelogin/ruby-saml/idp_metadata_parser.rb'
275+
- 'lib/onelogin/ruby-saml/utils.rb'
276+
283277
# Offense count: 1
284278
# This cop supports unsafe autocorrection (--autocorrect-all).
285279
# Configuration parameters: AllowSafeAssignment.
@@ -303,6 +297,11 @@ Lint/MissingSuper:
303297
- 'lib/onelogin/ruby-saml/slo_logoutrequest.rb'
304298
- 'lib/onelogin/ruby-saml/slo_logoutresponse.rb'
305299

300+
# Offense count: 2
301+
Lint/NoReturnInBeginEndBlocks:
302+
Exclude:
303+
- 'lib/onelogin/ruby-saml/idp_metadata_parser.rb'
304+
306305
# Offense count: 1
307306
# This cop supports unsafe autocorrection (--autocorrect-all).
308307
# Configuration parameters: AllowedImplicitNamespaces.
@@ -331,7 +330,7 @@ Lint/UselessAssignment:
331330
# Offense count: 39
332331
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
333332
Metrics/AbcSize:
334-
Max: 96
333+
Max: 101
335334

336335
# Offense count: 1
337336
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
@@ -418,6 +417,48 @@ Naming/VariableName:
418417
Exclude:
419418
- 'lib/onelogin/ruby-saml/utils.rb'
420419

420+
# Offense count: 2
421+
# This cop supports unsafe autocorrection (--autocorrect-all).
422+
Performance/Casecmp:
423+
Exclude:
424+
- 'lib/onelogin/ruby-saml/utils.rb'
425+
426+
# Offense count: 1
427+
# Configuration parameters: MinSize.
428+
Performance/CollectionLiteralInLoop:
429+
Exclude:
430+
- 'lib/onelogin/ruby-saml/response.rb'
431+
432+
# Offense count: 1
433+
# This cop supports safe autocorrection (--autocorrect).
434+
Performance/RegexpMatch:
435+
Exclude:
436+
- 'lib/onelogin/ruby-saml/idp_metadata_parser.rb'
437+
438+
# Offense count: 1
439+
# This cop supports safe autocorrection (--autocorrect).
440+
Performance/StringIdentifierArgument:
441+
Exclude:
442+
- 'lib/onelogin/ruby-saml/saml_message.rb'
443+
444+
# Offense count: 5
445+
# This cop supports unsafe autocorrection (--autocorrect-all).
446+
Performance/StringInclude:
447+
Exclude:
448+
- 'lib/onelogin/ruby-saml/authrequest.rb'
449+
- 'lib/onelogin/ruby-saml/logoutrequest.rb'
450+
- 'lib/onelogin/ruby-saml/slo_logoutresponse.rb'
451+
- 'lib/onelogin/ruby-saml/utils.rb'
452+
453+
# Offense count: 8
454+
# This cop supports safe autocorrection (--autocorrect).
455+
Performance/StringReplacement:
456+
Exclude:
457+
- 'lib/onelogin/ruby-saml/metadata.rb'
458+
- 'lib/onelogin/ruby-saml/saml_message.rb'
459+
- 'lib/onelogin/ruby-saml/utils.rb'
460+
- 'lib/xml_security.rb'
461+
421462
# Offense count: 54
422463
# This cop supports safe autocorrection (--autocorrect).
423464
# Configuration parameters: EnforcedStyle.
@@ -541,14 +582,13 @@ Style/GlobalStdStream:
541582
Exclude:
542583
- 'lib/onelogin/ruby-saml/logging.rb'
543584

544-
# Offense count: 5
585+
# Offense count: 4
545586
# This cop supports safe autocorrection (--autocorrect).
546587
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
547588
Style/GuardClause:
548589
Exclude:
549590
- 'lib/onelogin/ruby-saml/response.rb'
550591
- 'lib/onelogin/ruby-saml/utils.rb'
551-
- 'lib/xml_security.rb'
552592

553593
# Offense count: 69
554594
# This cop supports safe autocorrection (--autocorrect).
@@ -566,28 +606,30 @@ Style/IfUnlessModifier:
566606
- 'lib/onelogin/ruby-saml/utils.rb'
567607
- 'lib/xml_security.rb'
568608

569-
# Offense count: 20
609+
# Offense count: 2
570610
# This cop supports unsafe autocorrection (--autocorrect-all).
571611
# Configuration parameters: EnforcedStyle.
572612
# SupportedStyles: literals, strict
573613
Style/MutableConstant:
574614
Exclude:
575615
- 'lib/onelogin/ruby-saml/response.rb'
576616
- 'lib/onelogin/ruby-saml/saml_message.rb'
577-
- 'lib/onelogin/ruby-saml/utils.rb'
578-
- 'lib/onelogin/ruby-saml/version.rb'
579-
- 'lib/xml_security.rb'
580617

581-
# Offense count: 3
618+
# Offense count: 2
582619
# This cop supports safe autocorrection (--autocorrect).
583620
# Configuration parameters: EnforcedStyle.
584621
# SupportedStyles: both, prefix, postfix
585622
Style/NegatedIf:
586623
Exclude:
587-
- 'lib/onelogin/ruby-saml/idp_metadata_parser.rb'
588624
- 'lib/onelogin/ruby-saml/response.rb'
589625
- 'lib/onelogin/ruby-saml/settings.rb'
590626

627+
# Offense count: 1
628+
# This cop supports safe autocorrection (--autocorrect).
629+
Style/NegatedIfElseCondition:
630+
Exclude:
631+
- 'lib/onelogin/ruby-saml/authrequest.rb'
632+
591633
# Offense count: 6
592634
# This cop supports safe autocorrection (--autocorrect).
593635
# Configuration parameters: EnforcedStyle, MinBodyLength.
@@ -676,6 +718,13 @@ Style/PreferredHashMethods:
676718
Style/RaiseArgs:
677719
EnforcedStyle: compact
678720

721+
# Offense count: 2
722+
# This cop supports unsafe autocorrection (--autocorrect-all).
723+
# Configuration parameters: Methods.
724+
Style/RedundantArgument:
725+
Exclude:
726+
- 'lib/xml_security.rb'
727+
679728
# Offense count: 2
680729
# This cop supports safe autocorrection (--autocorrect).
681730
Style/RedundantBegin:

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ gem 'minitest', '~> 5.18', require: false
88
gem 'mocha', '~> 2.0', require: false
99
gem 'rake', '~> 13.0'
1010
gem 'rubocop', '~> 1.45.1'
11+
gem 'rubocop-minitest', '~> 0.22.2'
1112
gem 'rubocop-performance', '~> 1.16.0'
1213
gem 'rubocop-rake', '~> 0.6.0'
13-
gem 'rubocop-minitest', '~> 0.22.2'
1414
gem 'simplecov', '~> 0.22', require: false
1515
gem 'simplecov-lcov', '~> 0.8', require: false
1616
gem 'timecop', '~> 0.9', require: false

0 commit comments

Comments
 (0)