rubocop-airbnb 3.0.2 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 141798fe044dbd21e96c3495a051ada08333669e
4
- data.tar.gz: 11dcbb417edd30319f34390ee51d8b8e3c879449
2
+ SHA256:
3
+ metadata.gz: 9d15fbaae4390350367ffaf63eb8983bfd6b3f5b20b204a84396b1e52f7f6509
4
+ data.tar.gz: eb4b2cb7e6b3fb6a347c8c8aa1d3c189a5787d14b0d59db5a5993d4fe400a299
5
5
  SHA512:
6
- metadata.gz: 308b022b2a0dd0f32e729e9ff86df78fe404e1c1365f73a4277506d78b46666e2cd25421e1c4193f7c45754034d110e5898d73f3eef2dd201bad1a330cbaea2b
7
- data.tar.gz: 45b22abbe58c34ca5473ac3332cef3769b9b86168c98047c441afde95c42654f3ffd914614abfee8c0a8de3d61d64430d6f14bc9f05c92af019bbf66c795767c
6
+ metadata.gz: bc207a5af59c1eecfeaba405a3a216fae0afa3b54288b35249de115b9f6c1d5036f9ae3f692823ee0a5a3af64718cd7aef072f0e6402c6c4b305b7f6f13bdd5f
7
+ data.tar.gz: e99bd2c461379d8a13f20a880b2963b0d0241d8affa7028d67cff807573ffe9fe8053bd7d8bbe65174bf0d3021dd9c7a75c4456f9dd1c58e5fe340280554d5d0
data/CHANGELOG.md CHANGED
@@ -1,4 +1,15 @@
1
- # 3.02
1
+ # 4.0.0
2
+ * Add support for Ruby 3.0
3
+ * Run CI against Ruby 2.7
4
+ * Drop support for Ruby 2.3
5
+ * Update rubocop to 0.93.1
6
+ * Update rubocop-performance to 1.10.2
7
+ * Update rubocop-rails to 2.9.1
8
+ * Update rubocop-rspec to 1.44.1
9
+ * Disable Style/BracesAroundHashParameters
10
+ * Set `DisabledByDefault: true` to disable any new rubocop cops that have not yet been evaluated for this style guide
11
+
12
+ # 3.0.2
2
13
  * Moves `require`s for `rubocop-performance` and `rubocop-rails` to library code for better transitivity.
3
14
 
4
15
  # 3.0.1
data/config/default.yml CHANGED
@@ -24,6 +24,15 @@ AllCops:
24
24
  - spec/factories/**/*.rb
25
25
  - features/support/factories/**/*.rb
26
26
 
27
+ # While Rubocop has released a bunch of new cops, not all of these cops have been evaluated as
28
+ # part of this styleguide. To prevent new, unevaluated cops from imposing on this styleguide, we
29
+ # are marking these new cops as disabled. Note that as a consumer of this styleguide, you can
30
+ # always override any choices here by setting `Enabled: true` on any cops that you would like to
31
+ # have be enabled, even if we have explicitly disabled them (or if they are new and we have yet
32
+ # to evaluate them). For more on this configuration parameter, see
33
+ # https://github.com/rubocop/rubocop/blob/1e55b1aa5e4c5eaeccad5d61f08b7930ed6bc341/config/default.yml#L89-L101
34
+ DisabledByDefault: true
35
+
27
36
  inherit_from:
28
37
  - './rubocop-airbnb.yml'
29
38
  - './rubocop-bundler.yml'
@@ -11,13 +11,13 @@ Layout/AccessModifierIndentation:
11
11
  - indent
12
12
 
13
13
  # Supports --auto-correct
14
- Layout/AlignArray:
14
+ Layout/ArrayAlignment:
15
15
  Description: Align the elements of an array literal if they span more than one line.
16
16
  StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#align-multiline-arrays
17
17
  Enabled: true
18
18
 
19
19
  # Supports --auto-correct
20
- Layout/AlignHash:
20
+ Layout/HashAlignment:
21
21
  Description: Align the elements of a hash literal if they span more than one line.
22
22
  Enabled: true
23
23
  EnforcedHashRocketStyle: key
@@ -30,7 +30,7 @@ Layout/AlignHash:
30
30
  - ignore_explicit
31
31
 
32
32
  # Supports --auto-correct
33
- Layout/AlignParameters:
33
+ Layout/ParameterAlignment:
34
34
  Description: Align the parameters of a method call if they span more than one line.
35
35
  StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-double-indent
36
36
  Enabled: true
@@ -227,7 +227,7 @@ Layout/FirstMethodParameterLineBreak:
227
227
  Enabled: false
228
228
 
229
229
  # Supports --auto-correct
230
- Layout/IndentFirstArgument:
230
+ Layout/FirstArgumentIndentation:
231
231
  Description: Checks the indentation of the first parameter in a method call.
232
232
  Enabled: true
233
233
  EnforcedStyle: consistent
@@ -238,19 +238,19 @@ Layout/IndentFirstArgument:
238
238
  - special_for_inner_method_call_in_parentheses
239
239
 
240
240
  # Supports --auto-correct
241
- Layout/IndentFirstArrayElement:
241
+ Layout/FirstArrayElementIndentation:
242
242
  Description: Checks the indentation of the first element in an array literal.
243
243
  Enabled: true
244
244
  EnforcedStyle: consistent
245
245
 
246
246
  # Supports --auto-correct
247
- Layout/IndentAssignment:
247
+ Layout/AssignmentIndentation:
248
248
  Description: Checks the indentation of the first line of the right-hand-side of a
249
249
  multi-line assignment.
250
250
  Enabled: true
251
251
 
252
252
  # Supports --auto-correct
253
- Layout/IndentFirstHashElement:
253
+ Layout/FirstHashElementIndentation:
254
254
  Description: Checks the indentation of the first key in a hash literal.
255
255
  Enabled: true
256
256
  EnforcedStyle: consistent
@@ -258,7 +258,7 @@ Layout/IndentFirstHashElement:
258
258
  - special_inside_parentheses
259
259
  - consistent
260
260
 
261
- Layout/IndentHeredoc:
261
+ Layout/HeredocIndentation:
262
262
  Enabled: false
263
263
 
264
264
  # Supports --auto-correct
@@ -268,7 +268,7 @@ Layout/IndentationConsistency:
268
268
  EnforcedStyle: normal
269
269
  SupportedStyles:
270
270
  - normal
271
- - rails
271
+ - indented_internal_methods
272
272
 
273
273
  # Supports --auto-correct
274
274
  Layout/IndentationWidth:
@@ -282,7 +282,7 @@ Layout/InitialIndentation:
282
282
  Description: Checks the indentation of the first non-blank non-comment line in a file.
283
283
  Enabled: true
284
284
 
285
- Layout/LeadingBlankLines:
285
+ Layout/LeadingEmptyLines:
286
286
  Enabled: true
287
287
 
288
288
  # Supports --auto-correct
@@ -531,13 +531,13 @@ Layout/SpaceInsideStringInterpolation:
531
531
  - no_space
532
532
 
533
533
  # Supports --auto-correct
534
- Layout/Tab:
534
+ Layout/IndentationStyle:
535
535
  Description: No hard tabs.
536
536
  StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#spaces-indentation
537
537
  Enabled: true
538
538
 
539
539
  # Supports --auto-correct
540
- Layout/TrailingBlankLines:
540
+ Layout/TrailingEmptyLines:
541
541
  Description: Checks trailing blank lines and final newline.
542
542
  StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#newline-eof
543
543
  Enabled: true
@@ -552,5 +552,10 @@ Layout/TrailingWhitespace:
552
552
  StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-trailing-whitespace
553
553
  Enabled: true
554
554
 
555
- Layout/IndentFirstParameter:
555
+ Layout/FirstParameterIndentation:
556
556
  Enabled: true
557
+
558
+ # Supports --auto-correct
559
+ Layout/LineLength:
560
+ Max: 100
561
+ AllowURI: true
@@ -45,7 +45,7 @@ Lint/DuplicateMethods:
45
45
  Description: Check for duplicate methods calls.
46
46
  Enabled: true
47
47
 
48
- Lint/DuplicatedKey:
48
+ Lint/DuplicateHashKey:
49
49
  Description: Check for duplicate keys in hash literals.
50
50
  Enabled: true
51
51
 
@@ -68,10 +68,6 @@ Lint/EmptyInterpolation:
68
68
  Lint/EmptyWhen:
69
69
  Enabled: false
70
70
 
71
- Lint/EndInMethod:
72
- Description: END blocks should not be placed inside method definitions.
73
- Enabled: false
74
-
75
71
  Lint/EnsureReturn:
76
72
  Description: Do not use return in an ensure block.
77
73
  StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-return-ensure
@@ -93,7 +89,7 @@ Lint/FormatParameterMismatch:
93
89
  Description: The number of parameters to format/sprint must match the fields.
94
90
  Enabled: true
95
91
 
96
- Lint/HandleExceptions:
92
+ Lint/SuppressedException:
97
93
  Description: Don't suppress exception.
98
94
  StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#dont-hide-exceptions
99
95
  Enabled: false
@@ -144,7 +140,10 @@ Lint/MissingCopEnableDirective:
144
140
  Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`'
145
141
  Enabled: true
146
142
 
147
- Lint/MultipleCompare:
143
+ Lint/MissingSuper:
144
+ Enabled: false
145
+
146
+ Lint/MultipleComparison:
148
147
  Enabled: false
149
148
 
150
149
  Lint/NestedMethodDefinition:
@@ -230,7 +229,7 @@ Lint/ShadowingOuterLocalVariable:
230
229
  Enabled: true
231
230
 
232
231
  # Supports --auto-correct
233
- Lint/StringConversionInInterpolation:
232
+ Lint/RedundantStringCoercion:
234
233
  Description: Checks for Object#to_s usage in string interpolation.
235
234
  StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-to-s
236
235
  Enabled: true
@@ -289,7 +288,7 @@ Lint/UselessAssignment:
289
288
  StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#underscore-unused-vars
290
289
  Enabled: true
291
290
 
292
- Lint/UselessComparison:
291
+ Lint/BinaryOperatorWithIdenticalOperands:
293
292
  Description: Checks for comparison of something with itself.
294
293
  Enabled: true
295
294
 
@@ -21,10 +21,6 @@ Metrics/CyclomaticComplexity:
21
21
  Enabled: false
22
22
  Max: 6
23
23
 
24
- Metrics/LineLength:
25
- Max: 100
26
- AllowURI: true
27
-
28
24
  Metrics/MethodLength:
29
25
  Enabled: false
30
26
 
@@ -55,18 +55,18 @@ Naming/PredicateName:
55
55
  - is_
56
56
  - has_
57
57
  - have_
58
- NamePrefixBlacklist:
58
+ ForbiddenPrefixes:
59
59
  - is_
60
60
  - has_
61
61
  - have_
62
62
 
63
- Naming/UncommunicativeBlockParamName:
63
+ Naming/BlockParameterName:
64
64
  Description: >-
65
65
  Checks for block parameter names that contain capital letters,
66
66
  end in numbers, or do not meet a minimal length.
67
67
  Enabled: false
68
68
 
69
- Naming/UncommunicativeMethodParamName:
69
+ Naming/MethodParameterName:
70
70
  Description: >-
71
71
  Checks for method parameter names that contain capital letters,
72
72
  end in numbers, or do not meet a minimal length.
@@ -212,3 +212,7 @@ Rails/IgnoredSkipActionFilterOption:
212
212
 
213
213
  Rails/ReflectionClassName:
214
214
  Enabled: true
215
+
216
+ Rails/RakeEnvironment:
217
+ Description: Ensures that rake tasks depend on :environment
218
+ Enabled: false
@@ -134,16 +134,6 @@ Style/BlockDelimiters:
134
134
  - proc
135
135
  - it
136
136
 
137
- # Supports --auto-correct
138
- Style/BracesAroundHashParameters:
139
- Description: Enforce braces style around hash parameters.
140
- Enabled: false
141
- EnforcedStyle: no_braces
142
- SupportedStyles:
143
- - braces
144
- - no_braces
145
- - context_dependent
146
-
147
137
  Style/CaseEquality:
148
138
  Description: Avoid explicit use of the case equality operator(===).
149
139
  StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-case-equality
@@ -357,8 +347,9 @@ Style/FrozenStringLiteralComment:
357
347
  Enabled: false
358
348
  SupportedStyles:
359
349
  - always
350
+ - always_true
360
351
  - never
361
- EnforcedStyle: always
352
+ EnforcedStyle: always_true
362
353
 
363
354
  Style/GlobalVars:
364
355
  Description: Do not introduce global variables.
@@ -458,9 +449,6 @@ Style/MethodDefParentheses:
458
449
  - require_parentheses
459
450
  - require_no_parentheses
460
451
 
461
- Style/MethodMissingSuper:
462
- Enabled: false
463
-
464
452
  Style/MissingRespondToMissing:
465
453
  Enabled: false
466
454
 
@@ -824,6 +812,21 @@ Style/SpecialGlobalVars:
824
812
  StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-cryptic-perlisms
825
813
  Enabled: true
826
814
 
815
+ Style/HashEachMethods:
816
+ Description: Enforce use of each_key and each_value Hash methods.
817
+ StyleGuide: https://docs.rubocop.org/en/latest/cops_style/#stylehasheachmethods
818
+ Enabled: false
819
+
820
+ Style/HashTransformKeys:
821
+ Description: Enforce use of transform_keys Hash methods. Not suggested for use below ruby 2.5
822
+ StyleGuide: https://docs.rubocop.org/en/latest/cops_style/#stylehashtransformkeys
823
+ Enabled: false
824
+
825
+ Style/HashTransformValues:
826
+ Description: Enforce use of transform_values Hash methods. Not suggested for use below ruby 2.5
827
+ StyleGuide: https://docs.rubocop.org/en/latest/cops_style/#stylehashtransformvalues
828
+ Enabled: false
829
+
827
830
  Style/StabbyLambdaParentheses:
828
831
  Description: Check for the usage of parentheses around stabby lambda arguments.
829
832
  StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#stabby-lambda-with-args
@@ -3,6 +3,6 @@
3
3
  module RuboCop
4
4
  module Airbnb
5
5
  # Version information for the the Airbnb RuboCop plugin.
6
- VERSION = '3.0.2'
6
+ VERSION = '4.0.0'
7
7
  end
8
8
  end
@@ -14,7 +14,7 @@ module RuboCop
14
14
  alias on_send enforce_violation
15
15
  alias on_if enforce_violation
16
16
 
17
- RuboCop::AST::Node::ASSIGNMENTS.each do |type|
17
+ ::RuboCop::AST::Node::ASSIGNMENTS.each do |type|
18
18
  define_method("on_#{type}") do |node|
19
19
  enforce_violation(node)
20
20
  end
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.license = 'MIT'
16
16
  spec.version = RuboCop::Airbnb::VERSION
17
17
  spec.platform = Gem::Platform::RUBY
18
- spec.required_ruby_version = '>= 2.3'
18
+ spec.required_ruby_version = '>= 2.4'
19
19
 
20
20
  spec.require_paths = ['lib']
21
21
  spec.files = Dir[
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
25
25
  'Gemfile',
26
26
  ]
27
27
 
28
- spec.add_dependency('rubocop', '~> 0.76.0')
29
- spec.add_dependency('rubocop-performance', '~> 1.5.0')
30
- spec.add_dependency('rubocop-rails', '~> 2.3.2')
31
- spec.add_dependency('rubocop-rspec', '~> 1.30.0')
28
+ spec.add_dependency('rubocop', '~> 0.93.1')
29
+ spec.add_dependency('rubocop-performance', '~> 1.10.2')
30
+ spec.add_dependency('rubocop-rails', '~> 2.9.1')
31
+ spec.add_dependency('rubocop-rspec', '~> 1.44.1')
32
32
  spec.add_development_dependency('rspec', '~> 3.5')
33
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-airbnb
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbnb Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-15 00:00:00.000000000 Z
11
+ date: 2021-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.76.0
19
+ version: 0.93.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.76.0
26
+ version: 0.93.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop-performance
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.5.0
33
+ version: 1.10.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.5.0
40
+ version: 1.10.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubocop-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.3.2
47
+ version: 2.9.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.3.2
54
+ version: 2.9.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubocop-rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.30.0
61
+ version: 1.44.1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.30.0
68
+ version: 1.44.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -163,15 +163,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: '2.3'
166
+ version: '2.4'
167
167
  required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  requirements:
169
169
  - - ">="
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  requirements: []
173
- rubyforge_project:
174
- rubygems_version: 2.5.1
173
+ rubygems_version: 3.0.3
175
174
  signing_key:
176
175
  specification_version: 4
177
176
  summary: Custom code style checking for Airbnb.