rubocop-airbnb 3.0.2 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +19 -1
- data/config/default.yml +18 -8
- data/config/rubocop-layout.yml +18 -13
- data/config/rubocop-lint.yml +8 -9
- data/config/rubocop-metrics.yml +0 -4
- data/config/rubocop-naming.yml +3 -3
- data/config/rubocop-performance.yml +3 -0
- data/config/rubocop-rails.yml +7 -0
- data/config/rubocop-rspec.yml +4 -9
- data/config/rubocop-style.yml +17 -14
- data/lib/rubocop/airbnb/version.rb +1 -1
- data/lib/rubocop/cop/airbnb/class_or_module_declared_in_wrong_file.rb +1 -1
- data/lib/rubocop/cop/airbnb/const_assigned_in_wrong_file.rb +1 -1
- data/lib/rubocop/cop/airbnb/continuation_slash.rb +2 -2
- data/lib/rubocop/cop/airbnb/default_scope.rb +1 -1
- data/lib/rubocop/cop/airbnb/factory_attr_references_class.rb +1 -1
- data/lib/rubocop/cop/airbnb/factory_class_use_string.rb +1 -1
- data/lib/rubocop/cop/airbnb/mass_assignment_accessible_modifier.rb +1 -1
- data/lib/rubocop/cop/airbnb/module_method_in_wrong_file.rb +1 -1
- data/lib/rubocop/cop/airbnb/no_timeout.rb +1 -1
- data/lib/rubocop/cop/airbnb/opt_arg_parameters.rb +1 -1
- data/lib/rubocop/cop/airbnb/phrase_bundle_keys.rb +1 -1
- data/lib/rubocop/cop/airbnb/risky_activerecord_invocation.rb +1 -1
- data/lib/rubocop/cop/airbnb/rspec_describe_or_context_under_namespace.rb +1 -1
- data/lib/rubocop/cop/airbnb/rspec_environment_modification.rb +1 -1
- data/lib/rubocop/cop/airbnb/simple_modifier_conditional.rb +1 -1
- data/lib/rubocop/cop/airbnb/simple_unless.rb +1 -1
- data/lib/rubocop/cop/airbnb/spec_constant_assignment.rb +3 -4
- data/lib/rubocop/cop/airbnb/unsafe_yaml_marshal.rb +1 -1
- data/rubocop-airbnb.gemspec +5 -5
- data/spec/rubocop/cop/airbnb/class_or_module_declared_in_wrong_file_spec.rb +69 -102
- data/spec/rubocop/cop/airbnb/const_assigned_in_wrong_file_spec.rb +58 -101
- data/spec/rubocop/cop/airbnb/continuation_slash_spec.rb +77 -112
- data/spec/rubocop/cop/airbnb/default_scope_spec.rb +24 -31
- data/spec/rubocop/cop/airbnb/factory_attr_references_class_spec.rb +81 -121
- data/spec/rubocop/cop/airbnb/factory_class_use_string_spec.rb +12 -20
- data/spec/rubocop/cop/airbnb/mass_assignment_accessible_modifier_spec.rb +17 -22
- data/spec/rubocop/cop/airbnb/module_method_in_wrong_file_spec.rb +75 -114
- data/spec/rubocop/cop/airbnb/no_timeout_spec.rb +16 -22
- data/spec/rubocop/cop/airbnb/opt_arg_parameter_spec.rb +46 -73
- data/spec/rubocop/cop/airbnb/phrase_bundle_keys_spec.rb +5 -20
- data/spec/rubocop/cop/airbnb/risky_activerecord_invocation_spec.rb +19 -33
- data/spec/rubocop/cop/airbnb/rspec_describe_or_context_under_namespace_spec.rb +109 -187
- data/spec/rubocop/cop/airbnb/rspec_environment_modification_spec.rb +31 -41
- data/spec/rubocop/cop/airbnb/simple_modifier_conditional_spec.rb +64 -88
- data/spec/rubocop/cop/airbnb/simple_unless_spec.rb +17 -27
- data/spec/rubocop/cop/airbnb/spec_constant_assignment_spec.rb +42 -60
- data/spec/rubocop/cop/airbnb/unsafe_yaml_marshal_spec.rb +24 -36
- data/spec/spec_helper.rb +2 -0
- metadata +12 -13
@@ -1,64 +1,54 @@
|
|
1
|
-
describe RuboCop::Cop::Airbnb::RspecEnvironmentModification do
|
2
|
-
subject(:cop) { described_class.new }
|
3
|
-
|
1
|
+
describe RuboCop::Cop::Airbnb::RspecEnvironmentModification, :config do
|
4
2
|
before(:each) do
|
5
3
|
allow(cop).to receive(:is_spec_file?).and_return(true)
|
6
4
|
end
|
7
5
|
|
8
6
|
it 'does not allow assignment of Rails.env' do
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
expect(cop.offenses.size).to eql(1)
|
7
|
+
expect_offense(<<~RUBY)
|
8
|
+
Rails.env = :production
|
9
|
+
^^^^^^^^^^^^^^^^^^^^^^^ Do not stub or set Rails.env in specs. [...]
|
10
|
+
RUBY
|
14
11
|
end
|
15
12
|
|
16
13
|
it 'allows assignment of Rails.env when not in spec' do
|
17
14
|
allow(cop).to receive(:is_spec_file?).and_return(false)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
inspect_source(source)
|
22
|
-
expect(cop.offenses).to be_empty
|
15
|
+
expect_no_offenses(<<~RUBY)
|
16
|
+
Rails.env = :production
|
17
|
+
RUBY
|
23
18
|
end
|
24
19
|
|
25
20
|
it 'rejects allow style stubbing of Rails.env' do
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
expect(cop.offenses.size).to eql(1)
|
21
|
+
expect_offense(<<~RUBY)
|
22
|
+
def some_method(a)
|
23
|
+
allow(Rails.env).to receive(:production?)
|
24
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not stub or set Rails.env in specs. [...]
|
25
|
+
end
|
26
|
+
RUBY
|
33
27
|
end
|
34
28
|
|
35
29
|
it 'rejects expect style stubbing of Rails.env' do
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
expect(cop.offenses.size).to eql(1)
|
30
|
+
expect_offense(<<~RUBY)
|
31
|
+
def some_method(a)
|
32
|
+
expect(Rails.env).to receive(:production?)
|
33
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not stub or set Rails.env in specs. [...]
|
34
|
+
end
|
35
|
+
RUBY
|
43
36
|
end
|
44
37
|
|
45
38
|
it 'rejects .stub stubbing of Rails.env' do
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
expect(cop.offenses.size).to eql(1)
|
39
|
+
expect_offense(<<~RUBY)
|
40
|
+
def some_method(a)
|
41
|
+
Rails.env.stub(:production)
|
42
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not stub or set Rails.env in specs. [...]
|
43
|
+
end
|
44
|
+
RUBY
|
53
45
|
end
|
54
46
|
|
55
47
|
it 'allows stub_env' do
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
inspect_source(source)
|
62
|
-
expect(cop.offenses).to be_empty
|
48
|
+
expect_no_offenses(<<~RUBY)
|
49
|
+
def some_method(a)
|
50
|
+
stub_env(:production)
|
51
|
+
end
|
52
|
+
RUBY
|
63
53
|
end
|
64
54
|
end
|
@@ -1,122 +1,98 @@
|
|
1
|
-
describe RuboCop::Cop::Airbnb::SimpleModifierConditional do
|
2
|
-
subject(:cop) { described_class.new }
|
3
|
-
|
1
|
+
describe RuboCop::Cop::Airbnb::SimpleModifierConditional, :config do
|
4
2
|
context 'multiple conditionals' do
|
5
3
|
it 'rejects with modifier if with multiple conditionals' do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
inspect_source(source)
|
11
|
-
expect(cop.offenses.size).to eq(1)
|
4
|
+
expect_offense(<<~RUBY)
|
5
|
+
return true if some_method == 0 || another_method
|
6
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Modifier if/unless usage is okay when [...]
|
7
|
+
RUBY
|
12
8
|
end
|
13
9
|
|
14
10
|
it 'rejects with modifier unless with multiple conditionals' do
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
inspect_source(source)
|
20
|
-
expect(cop.offenses.size).to eq(1)
|
11
|
+
expect_offense(<<~RUBY)
|
12
|
+
return true unless true && false
|
13
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Modifier if/unless usage is okay when [...]
|
14
|
+
RUBY
|
21
15
|
end
|
22
16
|
|
23
17
|
it 'allows with modifier if operator conditional' do
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
inspect_source(source)
|
29
|
-
expect(cop.offenses).to be_empty
|
18
|
+
expect_no_offenses(<<~RUBY)
|
19
|
+
return true if some_method == 0
|
20
|
+
RUBY
|
30
21
|
end
|
31
22
|
|
32
23
|
it 'allows with modifier if with single conditional' do
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
inspect_source(source)
|
39
|
-
expect(cop.offenses).to be_empty
|
24
|
+
expect_no_offenses(<<~RUBY)
|
25
|
+
return true if some_method == 0
|
26
|
+
return true if another_method
|
27
|
+
RUBY
|
40
28
|
end
|
41
29
|
|
42
30
|
it 'allows with modifier if and unless with single conditional ' do
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
inspect_source(source)
|
49
|
-
expect(cop.offenses).to be_empty
|
31
|
+
expect_no_offenses(<<~RUBY)
|
32
|
+
return true if some_method
|
33
|
+
return true unless another_method > 5
|
34
|
+
RUBY
|
50
35
|
end
|
51
36
|
|
52
37
|
it 'allows multiple conditionals in block form' do
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
inspect_source(source)
|
60
|
-
expect(cop.offenses).to be_empty
|
38
|
+
expect_no_offenses(<<~RUBY)
|
39
|
+
if some_method == 0 && another_method > 5 || true || false
|
40
|
+
return true
|
41
|
+
end
|
42
|
+
RUBY
|
61
43
|
end
|
62
44
|
end
|
63
45
|
|
64
46
|
context 'multiple lines' do
|
65
47
|
it 'rejects modifier conditionals that span multiple lines' do
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
expect(cop.offenses.size).to eq(2)
|
48
|
+
expect_offense(<<~RUBY)
|
49
|
+
return true if true ||
|
50
|
+
^^^^^^^^^^^^^^^^^^^^^^ Modifier if/unless usage is okay when [...]
|
51
|
+
false
|
52
|
+
return true unless true ||
|
53
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^ Modifier if/unless usage is okay when [...]
|
54
|
+
false
|
55
|
+
RUBY
|
75
56
|
end
|
76
57
|
|
77
58
|
it 'rejects with modifier if with method that spans multiple lines' do
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
expect(cop.offenses.size).to eq(2)
|
59
|
+
expect_offense(<<~RUBY)
|
60
|
+
return true if some_method(param1,
|
61
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Modifier if/unless usage is okay when [...]
|
62
|
+
param2,
|
63
|
+
param3)
|
64
|
+
return true unless some_method(param1,
|
65
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Modifier if/unless usage is okay when [...]
|
66
|
+
param2,
|
67
|
+
param3)
|
68
|
+
RUBY
|
89
69
|
end
|
90
70
|
|
91
71
|
it 'rejects inline if/unless after a multiline statement' do
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
expect(cop.offenses.size).to eq(2)
|
72
|
+
expect_offense(<<~RUBY)
|
73
|
+
return some_method(
|
74
|
+
^^^^^^^^^^^^^^^^^^^ Modifier if/unless usage is okay when [...]
|
75
|
+
param1,
|
76
|
+
param2,
|
77
|
+
param3
|
78
|
+
) if another_method == 0
|
79
|
+
return some_method(
|
80
|
+
^^^^^^^^^^^^^^^^^^^ Modifier if/unless usage is okay when [...]
|
81
|
+
param1,
|
82
|
+
param2,
|
83
|
+
param3
|
84
|
+
) unless another_method == 0
|
85
|
+
RUBY
|
107
86
|
end
|
108
87
|
|
109
88
|
it 'allows multline conditionals in block form' do
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
inspect_source(source)
|
119
|
-
expect(cop.offenses).to be_empty
|
89
|
+
expect_no_offenses(<<~RUBY)
|
90
|
+
if some_method(param1,
|
91
|
+
param2,
|
92
|
+
parma3)
|
93
|
+
return true
|
94
|
+
end
|
95
|
+
RUBY
|
120
96
|
end
|
121
97
|
end
|
122
98
|
end
|
@@ -1,36 +1,26 @@
|
|
1
|
-
describe RuboCop::Cop::Airbnb::SimpleUnless do
|
2
|
-
subject(:cop) { described_class.new }
|
3
|
-
|
1
|
+
describe RuboCop::Cop::Airbnb::SimpleUnless, :config do
|
4
2
|
it 'rejects unless with multiple conditionals' do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
inspect_source(source)
|
12
|
-
expect(cop.offenses.size).to eq(1)
|
3
|
+
expect_offense(<<~RUBY)
|
4
|
+
unless boolean_condition || another_method
|
5
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unless usage is okay when there is only one conditional
|
6
|
+
return true
|
7
|
+
end
|
8
|
+
RUBY
|
13
9
|
end
|
14
10
|
|
15
11
|
it 'allows if with multiple conditionals' do
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
inspect_source(source)
|
23
|
-
expect(cop.offenses).to be_empty
|
12
|
+
expect_no_offenses(<<~RUBY)
|
13
|
+
if boolean_condition || another_method
|
14
|
+
return true
|
15
|
+
end
|
16
|
+
RUBY
|
24
17
|
end
|
25
18
|
|
26
19
|
it 'allows with modifier if operator conditional' do
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
inspect_source(source)
|
34
|
-
expect(cop.offenses).to be_empty
|
20
|
+
expect_no_offenses(<<~RUBY)
|
21
|
+
unless boolean_condition
|
22
|
+
return true
|
23
|
+
end
|
24
|
+
RUBY
|
35
25
|
end
|
36
26
|
end
|
@@ -1,80 +1,62 @@
|
|
1
|
-
describe RuboCop::Cop::Airbnb::SpecConstantAssignment do
|
2
|
-
subject(:cop) { described_class.new }
|
3
|
-
|
1
|
+
describe RuboCop::Cop::Airbnb::SpecConstantAssignment, :config do
|
4
2
|
it 'rejects constant definition inside of a describe block' do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
inspect_source(source)
|
12
|
-
expect(cop.offenses.size).to eq(1)
|
3
|
+
expect_offense(<<~RUBY)
|
4
|
+
describe Someclass do
|
5
|
+
CONSTANT = 5
|
6
|
+
^^^^^^^^^^^^ Defining constants inside of specs can cause spurious behavior. [...]
|
7
|
+
end
|
8
|
+
RUBY
|
13
9
|
end
|
14
10
|
|
15
11
|
it 'allows constant defined inside of a module' do
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
inspect_source(source)
|
23
|
-
expect(cop.offenses).to be_empty
|
12
|
+
expect_no_offenses(<<~RUBY)
|
13
|
+
module Someclass
|
14
|
+
CONSTANT = 5
|
15
|
+
end
|
16
|
+
RUBY
|
24
17
|
end
|
25
18
|
|
26
|
-
it '
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
inspect_source(source)
|
32
|
-
expect(cop.offenses.size).to eq(1)
|
19
|
+
it 'rejects constant defined in global space' do
|
20
|
+
expect_offense(<<~RUBY)
|
21
|
+
CONSTANT = 5
|
22
|
+
^^^^^^^^^^^^ Defining constants inside of specs can cause spurious behavior. [...]
|
23
|
+
RUBY
|
33
24
|
end
|
34
25
|
|
35
26
|
it 'rejects constant assignment inside a before block' do
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
inspect_source(source)
|
43
|
-
expect(cop.offenses.size).to eq(1)
|
27
|
+
expect_offense(<<~RUBY)
|
28
|
+
describe Someclass do
|
29
|
+
before { CONSTANT = 5 }
|
30
|
+
^^^^^^^^^^^^ Defining constants inside of specs can cause spurious behavior. [...]
|
31
|
+
end
|
32
|
+
RUBY
|
44
33
|
end
|
45
34
|
|
46
35
|
it 'rejects namespaced constant assignment inside a before block' do
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
inspect_source(source)
|
54
|
-
expect(cop.offenses.size).to eq(1)
|
36
|
+
expect_offense(<<~RUBY)
|
37
|
+
describe Someclass do
|
38
|
+
before { MyModule::CONSTANT = 5 }
|
39
|
+
^^^^^^^^^^^^^^^^^^^^^^ Defining constants inside of specs can cause spurious behavior. [...]
|
40
|
+
end
|
41
|
+
RUBY
|
55
42
|
end
|
56
43
|
|
57
44
|
it 'rejects constant assignment inside it block' do
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
inspect_source(source)
|
67
|
-
expect(cop.offenses.size).to eq(1)
|
45
|
+
expect_offense(<<~RUBY)
|
46
|
+
describe Someclass do
|
47
|
+
it "tests stuff" do
|
48
|
+
CONSTANT = 5
|
49
|
+
^^^^^^^^^^^^ Defining constants inside of specs can cause spurious behavior. [...]
|
50
|
+
end
|
51
|
+
end
|
52
|
+
RUBY
|
68
53
|
end
|
69
54
|
|
70
55
|
it 'allows let statements that do not assign constants' do
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
inspect_source(source)
|
78
|
-
expect(cop.offenses).to be_empty
|
56
|
+
expect_no_offenses(<<~RUBY)
|
57
|
+
describe Someclass do
|
58
|
+
let(:constant) { 5 }
|
59
|
+
end
|
60
|
+
RUBY
|
79
61
|
end
|
80
62
|
end
|
@@ -1,50 +1,38 @@
|
|
1
|
-
describe RuboCop::Cop::Airbnb::UnsafeYamlMarshal do
|
2
|
-
subject(:cop) { described_class.new }
|
3
|
-
|
1
|
+
describe RuboCop::Cop::Airbnb::UnsafeYamlMarshal, :config do
|
4
2
|
context 'send' do
|
5
3
|
it 'rejects YAML.load' do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
expect(cop.offenses.size).to eql(1)
|
13
|
-
expect(cop.offenses.first.message).to match(/`safe_load`, `parse`, `parse_file`/)
|
4
|
+
expect_offense(<<~RUBY)
|
5
|
+
def some_method(a)
|
6
|
+
YAML.load(a)
|
7
|
+
^^^^^^^^^^^^ Using `YAML.load` on untrusted input [...]
|
8
|
+
end
|
9
|
+
RUBY
|
14
10
|
end
|
15
11
|
|
16
12
|
it 'rejects Psych.load' do
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
expect(cop.offenses.size).to eql(1)
|
24
|
-
expect(cop.offenses.first.message).to match(/`safe_load`, `parse`, `parse_file`/)
|
13
|
+
expect_offense(<<~RUBY)
|
14
|
+
def some_method(a)
|
15
|
+
Psych.load(a)
|
16
|
+
^^^^^^^^^^^^^ Using `Psych.load` on untrusted input [...]
|
17
|
+
end
|
18
|
+
RUBY
|
25
19
|
end
|
26
20
|
|
27
21
|
it 'accepts YAML.safe_load' do
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
inspect_source(source)
|
34
|
-
expect(cop.offenses.size).to eql(0)
|
22
|
+
expect_no_offenses(<<~RUBY)
|
23
|
+
def some_method(a)
|
24
|
+
YAML.safe_load(a)
|
25
|
+
end
|
26
|
+
RUBY
|
35
27
|
end
|
36
28
|
|
37
29
|
it 'rejects on Marshal.load' do
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
expect(cop.offenses.size).to eql(1)
|
45
|
-
expect(cop.offenses.first.message).to match(
|
46
|
-
/`Marshal.load` on untrusted input can lead to remote code execution/
|
47
|
-
)
|
30
|
+
expect_offense(<<~RUBY)
|
31
|
+
def some_method(a)
|
32
|
+
Marshal.load(a)
|
33
|
+
^^^^^^^^^^^^^^^ Using `Marshal.load` on untrusted input can lead to remote code execution. [...]
|
34
|
+
end
|
35
|
+
RUBY
|
48
36
|
end
|
49
37
|
end
|
50
38
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -13,6 +13,8 @@ spec_helper_glob = File.expand_path('{support,shared}/*.rb', SpecHelper::ROOT)
|
|
13
13
|
Dir.glob(spec_helper_glob).map(&method(:require))
|
14
14
|
|
15
15
|
RSpec.configure do |config|
|
16
|
+
config.include RuboCop::RSpec::ExpectOffense
|
17
|
+
|
16
18
|
config.order = :random
|
17
19
|
|
18
20
|
# Define spec metadata for all rspec cop spec files
|
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:
|
4
|
+
version: 5.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:
|
11
|
+
date: 2023-02-13 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:
|
19
|
+
version: 1.22.0
|
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:
|
26
|
+
version: 1.22.0
|
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.
|
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.
|
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.
|
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.
|
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:
|
61
|
+
version: 2.0.0
|
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:
|
68
|
+
version: 2.0.0
|
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.
|
166
|
+
version: '2.5'
|
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
|
-
|
174
|
-
rubygems_version: 2.5.1
|
173
|
+
rubygems_version: 3.0.3.1
|
175
174
|
signing_key:
|
176
175
|
specification_version: 4
|
177
176
|
summary: Custom code style checking for Airbnb.
|