Skip to content

Commit 72de177

Browse files
committed
Updated rubocop to 1.23
1 parent c4aa448 commit 72de177

File tree

4 files changed

+163
-48
lines changed

4 files changed

+163
-48
lines changed

.codeclimate.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
plugins:
2+
fixme:
3+
enabled: true
4+
bundler-audit:
5+
enabled: true
6+
shellcheck:
7+
enabled: true
8+
rubocop:
9+
enabled: true
10+
channel: rubocop-1-23-0

.rubocop.yml

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

33
AllCops:
4-
TargetRubyVersion: 2.1
4+
TargetRubyVersion: 2.6
5+
NewCops: enable
6+
SuggestExtensions: false
57

68
Gemspec/RequiredRubyVersion:
79
Enabled: false
810

9-
Layout/AlignParameters:
11+
Layout/ParameterAlignment:
1012
EnforcedStyle: with_fixed_indentation
1113

1214
Layout/CaseIndentation:
@@ -15,7 +17,7 @@ Layout/CaseIndentation:
1517
Style/AsciiComments:
1618
Enabled: false
1719

18-
Layout/IndentHash:
20+
Layout/FirstHashElementIndentation:
1921
Enabled: false
2022

2123
Style/CollectionMethods:
@@ -30,10 +32,6 @@ Style/BlockDelimiters:
3032
Exclude:
3133
- spec/**/*_spec.rb
3234

33-
Style/BracesAroundHashParameters:
34-
Exclude:
35-
- spec/**/*_spec.rb
36-
3735
Style/GuardClause:
3836
Enabled: false
3937

@@ -53,15 +51,15 @@ Style/SignalException:
5351
Enabled: false
5452

5553
Metrics/AbcSize:
56-
Max: 20
54+
Max: 25
5755

5856
Metrics/ClassLength:
5957
Max: 101
6058

6159
Metrics/ModuleLength:
6260
Max: 100
6361

64-
Metrics/LineLength:
62+
Layout/LineLength:
6563
Enabled: false
6664

6765
Metrics/BlockLength:
@@ -74,7 +72,7 @@ Metrics/MethodLength:
7472
Style/SingleLineBlockParams:
7573
Enabled: false
7674

77-
Lint/EndAlignment:
75+
Layout/EndAlignment:
7876
EnforcedStyleAlignWith: variable
7977

8078
Style/FormatString:
@@ -92,7 +90,7 @@ Style/WordArray:
9290
Style/RedundantSelf:
9391
Enabled: false
9492

95-
Layout/AlignHash:
93+
Layout/HashAlignment:
9694
Enabled: true
9795
EnforcedLastArgumentHashStyle: always_ignore
9896

.rubocop_todo.yml

Lines changed: 143 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,39 @@
11
# This configuration was generated by
2-
# `rubocop --auto-gen-config`
3-
# on 2020-12-21 23:11:43 +0200 using RuboCop version 0.52.1.
2+
# `rubocop --auto-gen-config --exclude-limit 1000000`
3+
# on 2021-12-27 06:53:55 UTC using RuboCop version 1.23.0.
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
77
# versions of RuboCop, may require this file to be generated again.
88

99
# Offense count: 2
1010
# Cop supports --auto-correct.
11-
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
11+
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12+
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
13+
Bundler/OrderedGems:
14+
Exclude:
15+
- 'gemfiles/openssl.gemfile'
16+
- 'gemfiles/rbnacl.gemfile'
17+
18+
# Offense count: 1
19+
# Cop supports --auto-correct.
20+
# Configuration parameters: Include.
1221
# Include: **/*.gemspec
13-
Gemspec/OrderedDependencies:
22+
Gemspec/RequireMFA:
1423
Exclude:
1524
- 'ruby-jwt.gemspec'
1625

17-
# Offense count: 1
26+
# Offense count: 10
1827
# Cop supports --auto-correct.
19-
Layout/EmptyLines:
28+
Layout/EmptyLineAfterGuardClause:
2029
Exclude:
21-
- 'spec/integration/readme_examples_spec.rb'
30+
- 'lib/jwt/algos/ecdsa.rb'
31+
- 'lib/jwt/algos/eddsa.rb'
32+
- 'lib/jwt/algos/rsa.rb'
33+
- 'lib/jwt/decode.rb'
34+
- 'lib/jwt/jwk.rb'
35+
- 'lib/jwt/jwk/rsa.rb'
36+
- 'lib/jwt/verify.rb'
2237

2338
# Offense count: 1
2439
# Cop supports --auto-correct.
@@ -30,15 +45,25 @@ Layout/EmptyLinesAroundBlockBody:
3045

3146
# Offense count: 1
3247
# Cop supports --auto-correct.
33-
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
48+
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
3449
Layout/ExtraSpacing:
3550
Exclude:
3651
- 'spec/jwk_spec.rb'
3752

53+
# Offense count: 3
54+
# Cop supports --auto-correct.
55+
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
56+
# SupportedHashRocketStyles: key, separator, table
57+
# SupportedColonStyles: key, separator, table
58+
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
59+
Layout/HashAlignment:
60+
Exclude:
61+
- 'lib/jwt/algos/ecdsa.rb'
62+
3863
# Offense count: 2
3964
# Cop supports --auto-correct.
4065
# Configuration parameters: EnforcedStyle.
41-
# SupportedStyles: normal, rails
66+
# SupportedStyles: normal, indented_internal_methods
4267
Layout/IndentationConsistency:
4368
Exclude:
4469
- 'spec/jwt_spec.rb'
@@ -79,10 +104,27 @@ Layout/SpaceInsideBlockBraces:
79104
# Cop supports --auto-correct.
80105
# Configuration parameters: EnforcedStyle.
81106
# SupportedStyles: final_newline, final_blank_line
82-
Layout/TrailingBlankLines:
107+
Layout/TrailingEmptyLines:
83108
Exclude:
84109
- 'bin/console.rb'
85110

111+
# Offense count: 1
112+
# Cop supports --auto-correct.
113+
Lint/AmbiguousOperatorPrecedence:
114+
Exclude:
115+
- 'spec/integration/readme_examples_spec.rb'
116+
117+
# Offense count: 1
118+
# Configuration parameters: AllowComments, AllowEmptyLambdas.
119+
Lint/EmptyBlock:
120+
Exclude:
121+
- 'Appraisals'
122+
123+
# Offense count: 1
124+
Lint/MissingSuper:
125+
Exclude:
126+
- 'lib/jwt/jwk/key_base.rb'
127+
86128
# Offense count: 3
87129
# Cop supports --auto-correct.
88130
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
@@ -92,27 +134,64 @@ Lint/UnusedBlockArgument:
92134
- 'spec/jwk/ec_spec.rb'
93135
- 'spec/jwt/verify_spec.rb'
94136

95-
# Offense count: 2
96-
Metrics/CyclomaticComplexity:
97-
Max: 7
98-
99137
# Offense count: 1
100-
Metrics/PerceivedComplexity:
101-
Max: 8
138+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
139+
Metrics/AbcSize:
140+
Max: 25
102141

103142
# Offense count: 1
104143
# Cop supports --auto-correct.
105-
# Configuration parameters: MaxKeyValuePairs.
106-
Performance/RedundantMerge:
144+
# Configuration parameters: IgnoredMethods.
145+
# IgnoredMethods: ==, equal?, eql?
146+
Style/ClassEqualityComparison:
107147
Exclude:
108-
- 'spec/jwt_spec.rb'
148+
- 'lib/jwt/algos/rsa.rb'
109149

110150
# Offense count: 1
111151
# Cop supports --auto-correct.
112152
Style/Encoding:
113153
Exclude:
114154
- 'lib/jwt/version.rb'
115155

156+
# Offense count: 1
157+
# Cop supports --auto-correct.
158+
Style/ExpandPathArguments:
159+
Exclude:
160+
- 'ruby-jwt.gemspec'
161+
162+
# Offense count: 19
163+
# Cop supports --auto-correct.
164+
# Configuration parameters: EnforcedStyle.
165+
# SupportedStyles: always, always_true, never
166+
Style/FrozenStringLiteralComment:
167+
Exclude:
168+
- 'Appraisals'
169+
- 'Gemfile'
170+
- 'Rakefile'
171+
- 'bin/console.rb'
172+
- 'gemfiles/openssl.gemfile'
173+
- 'gemfiles/rbnacl.gemfile'
174+
- 'gemfiles/standalone.gemfile'
175+
- 'lib/jwt/algos/ecdsa.rb'
176+
- 'lib/jwt/algos/eddsa.rb'
177+
- 'lib/jwt/algos/hmac.rb'
178+
- 'lib/jwt/algos/none.rb'
179+
- 'lib/jwt/algos/ps.rb'
180+
- 'lib/jwt/algos/rsa.rb'
181+
- 'lib/jwt/algos/unsupported.rb'
182+
- 'lib/jwt/claims_validator.rb'
183+
- 'lib/jwt/default_options.rb'
184+
- 'lib/jwt/security_utils.rb'
185+
- 'ruby-jwt.gemspec'
186+
- 'spec/jwt/algos/ecdsa_spec.rb'
187+
188+
# Offense count: 2
189+
# Cop supports --auto-correct.
190+
Style/HashTransformKeys:
191+
Exclude:
192+
- 'lib/jwt/claims_validator.rb'
193+
- 'lib/jwt/encode.rb'
194+
116195
# Offense count: 1
117196
# Cop supports --auto-correct.
118197
# Configuration parameters: InverseMethods, InverseBlocks.
@@ -122,43 +201,77 @@ Style/InverseMethods:
122201

123202
# Offense count: 2
124203
# Cop supports --auto-correct.
204+
# Configuration parameters: IgnoredMethods.
125205
Style/MethodCallWithoutArgsParentheses:
126206
Exclude:
127207
- 'spec/jwt_spec.rb'
128208

129-
# Offense count: 2
130-
# Configuration parameters: EnforcedStyle.
131-
# SupportedStyles: module_function, extend_self
132-
Style/ModuleFunction:
133-
Exclude:
134-
- 'lib/jwt/algos.rb'
135-
- 'lib/jwt/signature.rb'
136-
137209
# Offense count: 1
138210
# Cop supports --auto-correct.
139-
Style/MutableConstant:
211+
# Configuration parameters: EnforcedStyle, Autocorrect.
212+
# SupportedStyles: module_function, extend_self, forbidden
213+
Style/ModuleFunction:
140214
Exclude:
141-
- 'lib/jwt/version.rb'
215+
- 'lib/jwt/signature.rb'
142216

143217
# Offense count: 1
144218
# Cop supports --auto-correct.
145219
# Configuration parameters: Strict.
146220
Style/NumericLiterals:
147221
MinDigits: 6
148222

223+
# Offense count: 1
224+
# Configuration parameters: AllowedMethods.
225+
# AllowedMethods: respond_to_missing?
226+
Style/OptionalBooleanParameter:
227+
Exclude:
228+
- 'lib/jwt.rb'
229+
149230
# Offense count: 1
150231
# Cop supports --auto-correct.
151232
Style/ParallelAssignment:
152233
Exclude:
153234
- 'spec/integration/readme_examples_spec.rb'
154235

155-
# Offense count: 11
236+
# Offense count: 5
237+
# Cop supports --auto-correct.
238+
Style/RedundantFreeze:
239+
Exclude:
240+
- 'lib/jwt/encode.rb'
241+
- 'lib/jwt/jwk/ec.rb'
242+
- 'lib/jwt/jwk/hmac.rb'
243+
- 'lib/jwt/jwk/rsa.rb'
244+
245+
# Offense count: 4
246+
# Cop supports --auto-correct.
247+
Style/RedundantRegexpEscape:
248+
Exclude:
249+
- 'spec/jwk/decode_with_jwk_spec.rb'
250+
251+
# Offense count: 1
252+
# Cop supports --auto-correct.
253+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
254+
# AllowedMethods: present?, blank?, presence, try, try!
255+
Style/SafeNavigation:
256+
Exclude:
257+
- 'lib/jwt/encode.rb'
258+
259+
# Offense count: 1
260+
# Cop supports --auto-correct.
261+
Style/SlicingWithRange:
262+
Exclude:
263+
- 'lib/jwt/security_utils.rb'
264+
265+
# Offense count: 27
156266
# Cop supports --auto-correct.
157267
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
158268
# SupportedStyles: single_quotes, double_quotes
159269
Style/StringLiterals:
160270
Exclude:
161271
- 'bin/console.rb'
272+
- 'gemfiles/openssl.gemfile'
273+
- 'gemfiles/rbnacl.gemfile'
274+
- 'gemfiles/standalone.gemfile'
162275
- 'spec/jwk/ec_spec.rb'
163276
- 'spec/jwk/rsa_spec.rb'
164277
- 'spec/jwk_spec.rb'
@@ -177,9 +290,3 @@ Style/TrailingCommaInArguments:
177290
Style/UnlessElse:
178291
Exclude:
179292
- 'spec/jwt_spec.rb'
180-
181-
# Offense count: 162
182-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
183-
# URISchemes: http, https
184-
Metrics/LineLength:
185-
Max: 420

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ source 'https://rubygems.org'
22

33
gemspec
44

5-
gem 'rubocop', '~> 0.52.0' # Same as codeclimate default
5+
gem 'rubocop', '~> 1.23.0' # Same as codeclimate default

0 commit comments

Comments
 (0)