rubocop-airbnb 6.0.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: badf32420d149c7d0f156905b025e12753c8d2138feca349ce157dd8f52acbb3
4
- data.tar.gz: 7da82ffbd161c9e168091daeb0c9c0571c7a72eb33b635646f68ddeacf10a2e4
3
+ metadata.gz: 659a6878548873c1b6736354126949f0825dc76a717263eb83cd6ee32ac02561
4
+ data.tar.gz: f6680699553af27121ae53305d27976d61de7e75ab61f9e2b70e0da13384a78e
5
5
  SHA512:
6
- metadata.gz: d7eb9157f6279bc33ab656247532e9332160c3a2934c00bbace9684e23397e17300d1346bb874dae2bed24c599aa3685a30166da9735f7adf5529c55122dcc4d
7
- data.tar.gz: d975235537cee012fa313562ee517ca34b7143d37ff975dbd3e0ccc4ffb9a3794982ab2871fe477fdedf2ef62ac0cf061e5383d0cdea7dafdbfbdd33144d3772
6
+ metadata.gz: 07315be1396edcd8ef9cb29a882fc9c7bf7f31b658704862698ba9664862c9bbad80690977474919dc1e5390bf2145148e9f347fb8ed84e1858d208572c0f527
7
+ data.tar.gz: 41c7d5db9b3bc0574a969ef1fb6453c3f2a604e78b8c03c7b7e29168b3b212220dab03af7d09774f1f5f13972800b2d728750e6b97bd12fb3529456ce5c8f9f1
data/CHANGELOG.md CHANGED
@@ -1,7 +1,23 @@
1
+ # 8.0.0
2
+ * [#72](https://github.com/airbnb/ruby/pull/212) Adopt Rubocop's plugin system (thanks @koic!)
3
+ * Bump minimum gem versions:
4
+ * `rubocop` from `'~> 1.61'` to `'~> 1.72'`
5
+ * `rubocop-performance` from `'~> 1.20'` to `'~> 1.24'`
6
+ * `rubocop-rails` from `'~> 2.24'` to `'~> 2.30'`
7
+ * `rubocop-rspec` from `'~> 2.26'` to `'~> 3.5'`
8
+ * Add explicit `rubocop-*` gem dependencies which have been extracted
9
+ * `rubocop-capybara` with min version `'~> 2.22'`
10
+ * `rubocop-factory_bot` with min version `'~> 2.27'`
11
+
12
+ # 7.0.0
13
+ * Add support for Ruby 3.3
14
+ * Drop support for Ruby 2.6
15
+ * Update rubocop to ~> 1.61
16
+
1
17
  # 6.0.0
2
18
  * Recover code analysis using `TargetRubyVersion` from Ruby 2.0 to 2.4
3
19
  * Drop support for Ruby 2.5
4
- * Update rubocop to 1.32.0
20
+ * Update rubocop to ~> 1.32.0
5
21
 
6
22
  # 5.0.0
7
23
  * Add support for Ruby 3.1
data/README.md CHANGED
@@ -29,7 +29,7 @@ ways to do this:
29
29
  First Create a new file `.rubocop_airbnb.yml` in the same directory as your `.rubocop.yml`
30
30
  this file should contain
31
31
  ```
32
- require:
32
+ plugins:
33
33
  - rubocop-airbnb
34
34
  ```
35
35
 
@@ -50,10 +50,13 @@ you could potentially experience a bunch of warnings from `.rubocop_todo.yml` fo
50
50
  Now you can run `rubocop` and it will automatically load the RuboCop Airbnb
51
51
  cops together with the standard cops.
52
52
 
53
+ > [!NOTE]
54
+ > The plugin system is supported in RuboCop 1.72+. In earlier versions, use `require` instead of `plugins`.
55
+
53
56
  ### Command line
54
57
 
55
58
  ```bash
56
- rubocop --require rubocop-airbnb
59
+ rubocop --plugin rubocop-airbnb
57
60
  ```
58
61
 
59
62
  ## The Cops
@@ -70,4 +73,3 @@ Airbnb/PhraseBundleKeys:
70
73
  Exclude:
71
74
  - spec/my_poorly_named_spec_file.rb
72
75
  ```
73
-
data/config/default.yml CHANGED
@@ -29,7 +29,7 @@ RSpec:
29
29
  Include:
30
30
  - _spec.rb
31
31
  - "(?:^|/)spec/"
32
- RSpec/FactoryBot:
32
+ FactoryBot:
33
33
  Include:
34
34
  - spec/factories/**/*.rb
35
35
  - features/support/factories/**/*.rb
@@ -37,6 +37,8 @@ RSpec/FactoryBot:
37
37
  inherit_from:
38
38
  - './rubocop-airbnb.yml'
39
39
  - './rubocop-bundler.yml'
40
+ - './rubocop-capybara.yml'
41
+ - './rubocop-factory_bot.yml'
40
42
  - './rubocop-gemspec.yml'
41
43
  - './rubocop-layout.yml'
42
44
  - './rubocop-lint.yml'
@@ -0,0 +1,6 @@
1
+ plugins:
2
+ - rubocop-capybara
3
+
4
+ Capybara/CurrentPathExpectation:
5
+ Description: Checks that no expectations are set on Capybara's `current_path`.
6
+ Enabled: false
@@ -0,0 +1,10 @@
1
+ plugins:
2
+ - rubocop-factory_bot
3
+
4
+ FactoryBot/AttributeDefinedStatically:
5
+ Description: Always declare attribute values as blocks.
6
+ Enabled: false
7
+
8
+ FactoryBot/CreateList:
9
+ Description: Checks for create_list usage.
10
+ Enabled: true
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-performance
3
3
 
4
4
  Performance/Caller:
@@ -122,4 +122,3 @@ Performance/UnfreezeString:
122
122
 
123
123
  Performance/UriDefaultParser:
124
124
  Enabled: false
125
-
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rails
3
3
 
4
4
  # before_action doesn't seem to exist, so this doesn't make sense.
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rspec
3
3
 
4
4
  RSpec/AlignLeftLetBrace:
@@ -53,6 +53,10 @@ RSpec/DescribedClass:
53
53
  Description: 'Use `described_class` for tested class / module'
54
54
  Enabled: false
55
55
 
56
+ RSpec/Dialect:
57
+ Description: Enforces custom RSpec dialects.
58
+ Enabled: false
59
+
56
60
  RSpec/EmptyExampleGroup:
57
61
  Description: Checks if an example group does not include any tests.
58
62
  Enabled: true
@@ -110,13 +114,6 @@ RSpec/ExpectOutput:
110
114
  Description: Checks for opportunities to use `expect { ... }.to output`.
111
115
  Enabled: false
112
116
 
113
- RSpec/FilePath:
114
- Description: 'Checks the file and folder naming of the spec file.'
115
- Enabled: false
116
- CustomTransform:
117
- RuboCop: rubocop
118
- RSpec: rspec
119
-
120
117
  RSpec/Focus:
121
118
  Description: Checks if examples are focused.
122
119
  Enabled: false
@@ -293,6 +290,17 @@ RSpec/SingleArgumentMessageChain:
293
290
  Description: Checks that chains of messages contain more than one element.
294
291
  Enabled: true
295
292
 
293
+ RSpec/SpecFilePathFormat:
294
+ Description: Checks that spec file paths are consistent and well-formed.
295
+ Enabled: false
296
+ CustomTransform:
297
+ RuboCop: rubocop
298
+ RSpec: rspec
299
+
300
+ RSpec/SpecFilePathSuffix:
301
+ Description: Checks that spec file paths suffix are consistent and well-formed.
302
+ Enabled: false
303
+
296
304
  RSpec/SubjectStub:
297
305
  Description: Checks for stubbed test subjects.
298
306
  Enabled: false
@@ -308,19 +316,3 @@ RSpec/VerifiedDoubles:
308
316
  RSpec/VoidExpect:
309
317
  Description: This cop checks void `expect()`.
310
318
  Enabled: false
311
-
312
- RSpec/Capybara/CurrentPathExpectation:
313
- Description: Checks that no expectations are set on Capybara's `current_path`.
314
- Enabled: false
315
-
316
- RSpec/Capybara/FeatureMethods:
317
- Description: Checks for consistent method usage in feature specs.
318
- Enabled: false
319
-
320
- RSpec/FactoryBot/AttributeDefinedStatically:
321
- Description: Always declare attribute values as blocks.
322
- Enabled: false
323
-
324
- RSpec/FactoryBot/CreateList:
325
- Description: Checks for create_list usage.
326
- Enabled: true
@@ -116,7 +116,7 @@ Style/BlockDelimiters:
116
116
  - let!
117
117
  - subject
118
118
  - watch
119
- IgnoredMethods:
119
+ AllowedMethods:
120
120
  # Methods that can be either procedural or functional and cannot be
121
121
  # categorised from their usage alone, e.g.
122
122
  #
@@ -889,7 +889,7 @@ Style/SymbolLiteral:
889
889
  Style/SymbolProc:
890
890
  Description: Use symbols as procs instead of blocks when possible.
891
891
  Enabled: false
892
- IgnoredMethods:
892
+ AllowedMethods:
893
893
  - respond_to
894
894
 
895
895
  Style/TernaryParentheses:
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lint_roller'
4
+
5
+ module RuboCop
6
+ module Airbnb
7
+ # A plugin that integrates RuboCop Airbnb with RuboCop's plugin system.
8
+ class Plugin < LintRoller::Plugin
9
+ def about
10
+ LintRoller::About.new(
11
+ name: 'rubocop-airbnb',
12
+ version: VERSION,
13
+ homepage: 'https://github.com/airbnb/ruby',
14
+ description: 'A plugin for RuboCop code style enforcing & linting tool.'
15
+ )
16
+ end
17
+
18
+ def supported?(context)
19
+ context.engine == :rubocop
20
+ end
21
+
22
+ def rules(_context)
23
+ LintRoller::Rules.new(
24
+ type: :path,
25
+ config_format: :rubocop,
26
+ value: Pathname.new(__dir__).join('../../../config/default.yml'),
27
+ )
28
+ end
29
+ end
30
+ end
31
+ end
@@ -3,6 +3,6 @@
3
3
  module RuboCop
4
4
  module Airbnb
5
5
  # Version information for the the Airbnb RuboCop plugin.
6
- VERSION = '6.0.0'
6
+ VERSION = '8.0.0'
7
7
  end
8
8
  end
@@ -8,9 +8,10 @@ module RuboCop
8
8
  'refactor data access patterns since the scope becomes part '\
9
9
  'of every query unless explicitly excluded, even when it is '\
10
10
  'unnecessary or incidental to the desired logic.'.freeze
11
+ RESTRICT_ON_SEND = %i(default_scope).freeze
11
12
 
12
13
  def on_send(node)
13
- return unless node.command?(:default_scope)
14
+ return if node.receiver
14
15
 
15
16
  add_offense(node)
16
17
  end
@@ -6,9 +6,10 @@ module RuboCop
6
6
  class FactoryClassUseString < Base
7
7
  MSG = 'Instead of :class => MyClass, use :class => "MyClass". ' \
8
8
  "This enables faster spec startup time and faster Zeus reload time.".freeze
9
+ RESTRICT_ON_SEND = %i(factory).freeze
9
10
 
10
11
  def on_send(node)
11
- return unless node.command?(:factory)
12
+ return if node.receiver
12
13
 
13
14
  class_pair = class_node(node)
14
15
 
@@ -5,11 +5,9 @@ module RuboCop
5
5
  # mass assignment. It's a lazy, potentially dangerous approach that should be discouraged.
6
6
  class MassAssignmentAccessibleModifier < Base
7
7
  MSG = 'Do no override and objects mass assignment restrictions.'.freeze
8
+ RESTRICT_ON_SEND = %i(accessible=).freeze
8
9
 
9
10
  def on_send(node)
10
- _receiver, method_name, *_args = *node
11
-
12
- return unless method_name == :accessible=
13
11
  add_offense(node, message: MSG)
14
12
  end
15
13
  end
@@ -8,9 +8,14 @@ module RuboCop
8
8
  'It can also cause logic errors since it can raise in ' \
9
9
  'any callee scope. Use client library timeouts and monitoring to ' \
10
10
  'ensure proper timing behavior for web requests.'.freeze
11
+ RESTRICT_ON_SEND = %i(timeout).freeze
12
+
13
+ def_node_matcher :timeout_const?, <<~PATTERN
14
+ (const {cbase nil?} :Timeout)
15
+ PATTERN
11
16
 
12
17
  def on_send(node)
13
- return unless node.source.start_with?('Timeout.timeout')
18
+ return unless timeout_const?(node.receiver)
14
19
  add_offense(node, message: MSG)
15
20
  end
16
21
  end
@@ -27,10 +27,11 @@ module RuboCop
27
27
  class PhraseBundleKeys < Base
28
28
  MESSAGE =
29
29
  'Phrase bundle keys should match their translation keys.'.freeze
30
+ RESTRICT_ON_SEND = %i(t).freeze
30
31
 
31
32
  def on_send(node)
32
33
  parent = node.parent
33
- if t_call?(node) && in_phrase_bundle_class?(node) && parent.pair_type?
34
+ if in_phrase_bundle_class?(node) && parent.pair_type?
34
35
  hash_key = parent.children[0]
35
36
  unless hash_key.children[0] == node.children[2].children[0]
36
37
  add_offense(hash_key, message: MESSAGE)
@@ -57,10 +58,6 @@ module RuboCop
57
58
  e.children[1] == :PhraseBundle
58
59
  end
59
60
  end
60
-
61
- def t_call?(node)
62
- node.children[1] == :t
63
- end
64
61
  end
65
62
  end
66
63
  end
@@ -3,7 +3,14 @@ module RuboCop
3
3
  module Airbnb
4
4
  # Disallow ActiveRecord calls that pass interpolated or added strings as an argument.
5
5
  class RiskyActiverecordInvocation < Base
6
- VULNERABLE_AR_METHODS = [
6
+ MSG = 'Passing a string computed by interpolation or addition to an ActiveRecord ' \
7
+ 'method is likely to lead to SQL injection. Use hash or parameterized syntax. For ' \
8
+ 'more information, see ' \
9
+ 'http://guides.rubyonrails.org/security.html#sql-injection-countermeasures and ' \
10
+ 'https://rails-sqli.org/rails3. If you have confirmed with Security that this is a ' \
11
+ 'safe usage of this style, disable this alert with ' \
12
+ '`# rubocop:disable Airbnb/RiskyActiverecordInvocation`.'.freeze
13
+ RESTRICT_ON_SEND = [
7
14
  :delete_all,
8
15
  :destroy_all,
9
16
  :exists?,
@@ -22,29 +29,15 @@ module RuboCop
22
29
  :update_all,
23
30
  :where,
24
31
  ].freeze
25
- MSG = 'Passing a string computed by interpolation or addition to an ActiveRecord ' \
26
- 'method is likely to lead to SQL injection. Use hash or parameterized syntax. For ' \
27
- 'more information, see ' \
28
- 'http://guides.rubyonrails.org/security.html#sql-injection-countermeasures and ' \
29
- 'https://rails-sqli.org/rails3. If you have confirmed with Security that this is a ' \
30
- 'safe usage of this style, disable this alert with ' \
31
- '`# rubocop:disable Airbnb/RiskyActiverecordInvocation`.'.freeze
32
32
  def on_send(node)
33
- receiver, method_name, *_args = *node
34
-
35
- return if receiver.nil?
36
- return unless vulnerable_ar_method?(method_name)
37
- if !includes_interpolation?(_args) && !includes_sum?(_args)
33
+ return if node.receiver.nil?
34
+ if !includes_interpolation?(node.arguments) && !includes_sum?(node.arguments)
38
35
  return
39
36
  end
40
37
 
41
38
  add_offense(node)
42
39
  end
43
40
 
44
- def vulnerable_ar_method?(method)
45
- VULNERABLE_AR_METHODS.include?(method)
46
- end
47
-
48
41
  # Return true if the first arg is a :dstr that has non-:str components
49
42
  def includes_interpolation?(args)
50
43
  !args.first.nil? &&
@@ -40,6 +40,7 @@ module RuboCop
40
40
  def_node_matcher :rails_env_assignment, '(send (const nil? :Rails) :env= ...)'
41
41
 
42
42
  MESSAGE = "Do not stub or set Rails.env in specs. Use the `stub_env` method instead".freeze
43
+ RESTRICT_ON_SEND = %i(to stub env=).freeze
43
44
 
44
45
  def on_send(node)
45
46
  path = node.source_range.source_buffer.name
@@ -6,35 +6,34 @@ module RuboCop
6
6
  MSG = 'Using unsafe YAML parsing methods on untrusted input can lead ' \
7
7
  'to remote code execution. Use `safe_load`, `parse`, `parse_file`, or ' \
8
8
  '`parse_stream` instead'.freeze
9
+ RESTRICT_ON_SEND = %i(load load_documents load_file load_stream).freeze
9
10
 
10
11
  def on_send(node)
11
- receiver, method_name, *_args = *node
12
+ return if node.receiver.nil?
13
+ return unless node.receiver.const_type?
12
14
 
13
- return if receiver.nil?
14
- return unless receiver.const_type?
15
-
16
- check_yaml(node, receiver, method_name, *_args)
17
- check_marshal(node, receiver, method_name, *_args)
15
+ check_yaml(node)
16
+ check_marshal(node)
18
17
  rescue => e
19
18
  puts e
20
19
  puts e.backtrace
21
20
  raise
22
21
  end
23
22
 
24
- def check_yaml(node, receiver, method_name, *_args)
25
- return unless ['YAML', 'Psych'].include?(receiver.const_name)
26
- return unless [:load, :load_documents, :load_file, :load_stream].include?(method_name)
23
+ def check_yaml(node)
24
+ const_name = node.receiver.const_name
25
+ return unless ['YAML', 'Psych'].include?(const_name)
27
26
 
28
- message = "Using `#{receiver.const_name}.#{method_name}` on untrusted input can lead " \
27
+ message = "Using `#{const_name}.#{node.method_name}` on untrusted input can lead " \
29
28
  "to remote code execution. Use `safe_load`, `parse`, `parse_file`, or " \
30
29
  "`parse_stream` instead"
31
30
 
32
31
  add_offense(node, message: message)
33
32
  end
34
33
 
35
- def check_marshal(node, receiver, method_name, *_args)
36
- return unless receiver.const_name == 'Marshal'
37
- return unless method_name == :load
34
+ def check_marshal(node)
35
+ return unless node.receiver.const_name == 'Marshal'
36
+ return unless node.method?(:load)
38
37
 
39
38
  message = 'Using `Marshal.load` on untrusted input can lead to remote code execution. ' \
40
39
  'Restructure your code to not use Marshal'
@@ -7,8 +7,6 @@ require 'rubocop'
7
7
  require 'rubocop-performance'
8
8
  require 'rubocop-rails'
9
9
 
10
- require 'rubocop/airbnb'
11
- require 'rubocop/airbnb/inject'
12
- require 'rubocop/airbnb/version'
13
-
14
- RuboCop::Airbnb::Inject.defaults!
10
+ require_relative 'rubocop/airbnb'
11
+ require_relative 'rubocop/airbnb/plugin'
12
+ require_relative 'rubocop/airbnb/version'
@@ -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.5'
18
+ spec.required_ruby_version = '>= 2.7'
19
19
 
20
20
  spec.require_paths = ['lib']
21
21
  spec.files = Dir[
@@ -25,9 +25,14 @@ Gem::Specification.new do |spec|
25
25
  'Gemfile',
26
26
  ]
27
27
 
28
- spec.add_dependency('rubocop', '~> 1.32.0')
29
- spec.add_dependency('rubocop-performance', '~> 1.10.2')
30
- spec.add_dependency('rubocop-rails', '~> 2.9.1')
31
- spec.add_dependency('rubocop-rspec', '~> 2.0.0')
28
+ spec.metadata['default_lint_roller_plugin'] = 'RuboCop::Airbnb::Plugin'
29
+
30
+ spec.add_dependency('lint_roller', '~> 1.1')
31
+ spec.add_dependency('rubocop', '~> 1.72')
32
+ spec.add_dependency('rubocop-capybara', '~> 2.22')
33
+ spec.add_dependency('rubocop-factory_bot', '~> 2.27')
34
+ spec.add_dependency('rubocop-performance', '~> 1.24')
35
+ spec.add_dependency('rubocop-rails', '~> 2.30')
36
+ spec.add_dependency('rubocop-rspec', '~> 3.5')
32
37
  spec.add_development_dependency('rspec', '~> 3.5')
33
38
  end
@@ -11,6 +11,17 @@ describe RuboCop::Cop::Airbnb::NoTimeout, :config do
11
11
  RUBY
12
12
  end
13
13
 
14
+ it 'rejects ::Timeout.timeout' do
15
+ expect_offense(<<~RUBY)
16
+ def some_method(a)
17
+ ::Timeout.timeout(5) do
18
+ ^^^^^^^^^^^^^^^^^^^^ Do not use Timeout.timeout. [...]
19
+ some_other_method(a)
20
+ end
21
+ end
22
+ RUBY
23
+ end
24
+
14
25
  it 'accepts foo.timeout' do
15
26
  expect_no_offenses(<<~RUBY)
16
27
  def some_method(a)
metadata CHANGED
@@ -1,71 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-airbnb
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 8.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: 2023-02-28 00:00:00.000000000 Z
11
+ date: 2025-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: lint_roller
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rubocop
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: 1.32.0
33
+ version: '1.72'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: 1.32.0
40
+ version: '1.72'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-capybara
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.22'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.22'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-factory_bot
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.27'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.27'
27
69
  - !ruby/object:Gem::Dependency
28
70
  name: rubocop-performance
29
71
  requirement: !ruby/object:Gem::Requirement
30
72
  requirements:
31
73
  - - "~>"
32
74
  - !ruby/object:Gem::Version
33
- version: 1.10.2
75
+ version: '1.24'
34
76
  type: :runtime
35
77
  prerelease: false
36
78
  version_requirements: !ruby/object:Gem::Requirement
37
79
  requirements:
38
80
  - - "~>"
39
81
  - !ruby/object:Gem::Version
40
- version: 1.10.2
82
+ version: '1.24'
41
83
  - !ruby/object:Gem::Dependency
42
84
  name: rubocop-rails
43
85
  requirement: !ruby/object:Gem::Requirement
44
86
  requirements:
45
87
  - - "~>"
46
88
  - !ruby/object:Gem::Version
47
- version: 2.9.1
89
+ version: '2.30'
48
90
  type: :runtime
49
91
  prerelease: false
50
92
  version_requirements: !ruby/object:Gem::Requirement
51
93
  requirements:
52
94
  - - "~>"
53
95
  - !ruby/object:Gem::Version
54
- version: 2.9.1
96
+ version: '2.30'
55
97
  - !ruby/object:Gem::Dependency
56
98
  name: rubocop-rspec
57
99
  requirement: !ruby/object:Gem::Requirement
58
100
  requirements:
59
101
  - - "~>"
60
102
  - !ruby/object:Gem::Version
61
- version: 2.0.0
103
+ version: '3.5'
62
104
  type: :runtime
63
105
  prerelease: false
64
106
  version_requirements: !ruby/object:Gem::Requirement
65
107
  requirements:
66
108
  - - "~>"
67
109
  - !ruby/object:Gem::Version
68
- version: 2.0.0
110
+ version: '3.5'
69
111
  - !ruby/object:Gem::Dependency
70
112
  name: rspec
71
113
  requirement: !ruby/object:Gem::Requirement
@@ -97,6 +139,8 @@ files:
97
139
  - config/default.yml
98
140
  - config/rubocop-airbnb.yml
99
141
  - config/rubocop-bundler.yml
142
+ - config/rubocop-capybara.yml
143
+ - config/rubocop-factory_bot.yml
100
144
  - config/rubocop-gemspec.yml
101
145
  - config/rubocop-layout.yml
102
146
  - config/rubocop-lint.yml
@@ -110,7 +154,7 @@ files:
110
154
  - lib/rubocop-airbnb.rb
111
155
  - lib/rubocop/airbnb.rb
112
156
  - lib/rubocop/airbnb/inflections.rb
113
- - lib/rubocop/airbnb/inject.rb
157
+ - lib/rubocop/airbnb/plugin.rb
114
158
  - lib/rubocop/airbnb/rails_autoloading.rb
115
159
  - lib/rubocop/airbnb/version.rb
116
160
  - lib/rubocop/cop/airbnb/class_or_module_declared_in_wrong_file.rb
@@ -154,7 +198,8 @@ files:
154
198
  homepage: https://github.com/airbnb/ruby
155
199
  licenses:
156
200
  - MIT
157
- metadata: {}
201
+ metadata:
202
+ default_lint_roller_plugin: RuboCop::Airbnb::Plugin
158
203
  post_install_message:
159
204
  rdoc_options: []
160
205
  require_paths:
@@ -163,7 +208,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
208
  requirements:
164
209
  - - ">="
165
210
  - !ruby/object:Gem::Version
166
- version: '2.5'
211
+ version: '2.7'
167
212
  required_rubygems_version: !ruby/object:Gem::Requirement
168
213
  requirements:
169
214
  - - ">="
@@ -1,20 +0,0 @@
1
- # Straight up ripped from the custom Rspec rubocop
2
- # https://github.com/nevir/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb
3
- require 'yaml'
4
-
5
- module RuboCop
6
- module Airbnb
7
- # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
8
- # bit of our configuration.
9
- module Inject
10
- def self.defaults!
11
- path = CONFIG_DEFAULT.to_s
12
- hash = ConfigLoader.load_file(path).to_hash
13
- config = Config.new(hash, path)
14
- puts "configuration from #{path}" if ConfigLoader.debug?
15
- config = ConfigLoader.merge_with_default(config, path)
16
- ConfigLoader.instance_variable_set(:@default_configuration, config)
17
- end
18
- end
19
- end
20
- end