simplycop 1.12.12 → 1.12.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.simplycop.yml +103 -0
- data/.simplycop_rspec.yml +67 -0
- data/lib/simplycop/custom_cops/dont_print_all_env.rb +4 -4
- data/lib/simplycop/security/reject_all_requests_local.rb +2 -2
- data/lib/simplycop/version.rb +1 -1
- data/simplycop.gemspec +3 -3
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81791402713e30674d8eb5dad084403245144a057fb20a853a6bae54de1ad0de
|
4
|
+
data.tar.gz: de02d689bf85e8688e6eff3679eccfb32cb63f3dd96186c56e4a8b223c091b18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ca68ef630434db92fd3061830f2838e279e707a5174572034a439dfaf13ff93c354aacedcff663ed1c7c552a88456a115c5b86ad2ac6b8ba1896b9849f6f6f7
|
7
|
+
data.tar.gz: fcf1c9c832e18ae52609837ce4657b72ba32eb85168ef526dcaf3c497b1b9dff54153aa0b851fd1f9b3620e94e1d83b6c65ae335945f65b172f6d0b8498b87ed
|
data/.simplycop.yml
CHANGED
@@ -36,6 +36,15 @@ Layout/FirstHashElementLineBreak:
|
|
36
36
|
Layout/HeredocArgumentClosingParenthesis:
|
37
37
|
Enabled: true
|
38
38
|
|
39
|
+
Layout/LineContinuationLeadingSpace:
|
40
|
+
Enabled: true
|
41
|
+
|
42
|
+
Layout/LineContinuationSpacing:
|
43
|
+
Enabled: true
|
44
|
+
|
45
|
+
Layout/LineEndStringConcatenationIndentation:
|
46
|
+
Enabled: true
|
47
|
+
|
39
48
|
Layout/SpaceBeforeBrackets:
|
40
49
|
Enabled: true
|
41
50
|
|
@@ -46,12 +55,24 @@ Lint/AmbiguousBlockAssociation:
|
|
46
55
|
Exclude:
|
47
56
|
- spec/**/*
|
48
57
|
|
58
|
+
Lint/AmbiguousOperatorPrecedence:
|
59
|
+
Enabled: true
|
60
|
+
|
61
|
+
Lint/AmbiguousRange:
|
62
|
+
Enabled: true
|
63
|
+
|
49
64
|
Lint/DeprecatedConstants:
|
50
65
|
Enabled: true
|
51
66
|
|
52
67
|
Lint/DuplicateBranch:
|
53
68
|
Enabled: true
|
54
69
|
|
70
|
+
Lint/DuplicateMagicComment:
|
71
|
+
Enabled: true
|
72
|
+
|
73
|
+
Lint/DuplicateMethods:
|
74
|
+
Enabled: true
|
75
|
+
|
55
76
|
Lint/DuplicateRegexpCharacterClassElement:
|
56
77
|
Enabled: true
|
57
78
|
|
@@ -70,6 +91,9 @@ Lint/LambdaWithoutLiteralBlock:
|
|
70
91
|
Lint/NoReturnInBeginEndBlocks:
|
71
92
|
Enabled: true
|
72
93
|
|
94
|
+
Lint/NonAtomicFileOperation:
|
95
|
+
Enabled: true
|
96
|
+
|
73
97
|
Lint/NumberedParameterAssignment:
|
74
98
|
Enabled: true
|
75
99
|
|
@@ -79,6 +103,15 @@ Lint/OrAssignmentToConstant:
|
|
79
103
|
Lint/RedundantDirGlobSort:
|
80
104
|
Enabled: true
|
81
105
|
|
106
|
+
Lint/RefinementImportMethods:
|
107
|
+
Enabled: true
|
108
|
+
|
109
|
+
Lint/RequireRangeParentheses:
|
110
|
+
Enabled: true
|
111
|
+
|
112
|
+
Lint/RequireRelativeSelfPath:
|
113
|
+
Enabled: true
|
114
|
+
|
82
115
|
Lint/SymbolConversion:
|
83
116
|
Enabled: true
|
84
117
|
|
@@ -94,6 +127,9 @@ Lint/UnexpectedBlockArity:
|
|
94
127
|
Lint/UnmodifiedReduceAccumulator:
|
95
128
|
Enabled: true
|
96
129
|
|
130
|
+
Lint/UselessRuby2Keywords:
|
131
|
+
Enabled: true
|
132
|
+
|
97
133
|
Metrics/BlockLength:
|
98
134
|
Exclude:
|
99
135
|
- spec/**/*.rb
|
@@ -101,8 +137,24 @@ Metrics/BlockLength:
|
|
101
137
|
Metrics/ClassLength:
|
102
138
|
Max: 512
|
103
139
|
|
140
|
+
Metrics/ParameterLists:
|
141
|
+
CountKeywordArgs: false
|
142
|
+
Enabled: true
|
143
|
+
|
144
|
+
Naming/InclusiveLanguage:
|
145
|
+
Enabled: true
|
146
|
+
|
104
147
|
###### COPS REVIEWED ABOVE THIS LINE ######
|
105
148
|
|
149
|
+
Security/CompoundHash:
|
150
|
+
Enabled: true
|
151
|
+
|
152
|
+
Security/IoMethods:
|
153
|
+
Enabled: true
|
154
|
+
|
155
|
+
Style/AccessModifierDeclarations:
|
156
|
+
Enabled: false
|
157
|
+
|
106
158
|
Style/AccessorGrouping:
|
107
159
|
Enabled: true
|
108
160
|
|
@@ -115,6 +167,9 @@ Style/ArgumentsForwarding:
|
|
115
167
|
Style/ArrayCoercion:
|
116
168
|
Enabled: true
|
117
169
|
|
170
|
+
Style/ArrayIntersect:
|
171
|
+
Enabled: true
|
172
|
+
|
118
173
|
Style/BisectedAttrAccessor:
|
119
174
|
Enabled: true
|
120
175
|
|
@@ -131,6 +186,9 @@ Style/ColonMethodCall:
|
|
131
186
|
Style/CombinableLoops:
|
132
187
|
Enabled: true
|
133
188
|
|
189
|
+
Style/ConcatArrayLiterals:
|
190
|
+
Enabled: true
|
191
|
+
|
134
192
|
Style/ConditionalAssignment:
|
135
193
|
Enabled: true
|
136
194
|
|
@@ -143,12 +201,21 @@ Style/Documentation:
|
|
143
201
|
Style/EndlessMethod:
|
144
202
|
Enabled: true
|
145
203
|
|
204
|
+
Style/EnvHome:
|
205
|
+
Enabled: true
|
206
|
+
|
146
207
|
Style/ExplicitBlockArgument:
|
147
208
|
Enabled: true
|
148
209
|
|
149
210
|
Style/ExponentialNotation:
|
150
211
|
Enabled: false
|
151
212
|
|
213
|
+
Style/FetchEnvVar:
|
214
|
+
Enabled: true
|
215
|
+
|
216
|
+
Style/FileWrite:
|
217
|
+
Enabled: true
|
218
|
+
|
152
219
|
Style/For:
|
153
220
|
Enabled: true
|
154
221
|
|
@@ -191,6 +258,9 @@ Style/HashTransformValues:
|
|
191
258
|
Style/IfInsideElse:
|
192
259
|
Enabled: true
|
193
260
|
|
261
|
+
Style/IfUnlessModifier:
|
262
|
+
Enabled: false
|
263
|
+
|
194
264
|
Style/IfWithBooleanLiteralBranches:
|
195
265
|
Enabled: true
|
196
266
|
|
@@ -200,6 +270,9 @@ Style/KeywordParametersOrder:
|
|
200
270
|
Style/LambdaCall:
|
201
271
|
Enabled: true
|
202
272
|
|
273
|
+
Style/MapToHash:
|
274
|
+
Enabled: true
|
275
|
+
|
203
276
|
Style/MethodDefParentheses:
|
204
277
|
Enabled: true
|
205
278
|
|
@@ -227,6 +300,12 @@ Style/NilLambda:
|
|
227
300
|
Style/NumericPredicate:
|
228
301
|
Enabled: false
|
229
302
|
|
303
|
+
Style/OpenStructUse:
|
304
|
+
Enabled: true
|
305
|
+
|
306
|
+
Style/OperatorMethodCall:
|
307
|
+
Enabled: true
|
308
|
+
|
230
309
|
Style/OptionalArguments:
|
231
310
|
Enabled: true
|
232
311
|
|
@@ -236,6 +315,9 @@ Style/OptionalBooleanParameter:
|
|
236
315
|
Style/ParenthesesAroundCondition:
|
237
316
|
Enabled: true
|
238
317
|
|
318
|
+
Style/QuotedSymbols:
|
319
|
+
Enabled: true
|
320
|
+
|
239
321
|
Style/RedundantArgument:
|
240
322
|
Enabled: false
|
241
323
|
|
@@ -248,6 +330,12 @@ Style/RedundantBegin:
|
|
248
330
|
Style/RedundantConstantBase:
|
249
331
|
Enabled: false
|
250
332
|
|
333
|
+
Style/RedundantDoubleSplatHashBraces:
|
334
|
+
Enabled: true
|
335
|
+
|
336
|
+
Style/RedundantEach:
|
337
|
+
Enabled: true
|
338
|
+
|
251
339
|
Style/RedundantException:
|
252
340
|
Enabled: true
|
253
341
|
|
@@ -257,6 +345,9 @@ Style/RedundantFetchBlock:
|
|
257
345
|
Style/RedundantFileExtensionInRequire:
|
258
346
|
Enabled: true
|
259
347
|
|
348
|
+
Style/RedundantInitialize:
|
349
|
+
Enabled: true
|
350
|
+
|
260
351
|
Style/RedundantInterpolation:
|
261
352
|
Enabled: false
|
262
353
|
|
@@ -276,6 +367,18 @@ Style/RedundantReturn:
|
|
276
367
|
Style/RedundantSelfAssignment:
|
277
368
|
Enabled: true
|
278
369
|
|
370
|
+
Style/RedundantSelfAssignmentBranch:
|
371
|
+
Enabled: true
|
372
|
+
|
373
|
+
Style/RedundantStringEscape:
|
374
|
+
Enabled: true
|
375
|
+
|
376
|
+
Style/SafeNavigation:
|
377
|
+
Enabled: false
|
378
|
+
|
379
|
+
Style/SelectByRegexp:
|
380
|
+
Enabled: true
|
381
|
+
|
279
382
|
Style/SelfAssignment:
|
280
383
|
Enabled: true
|
281
384
|
|
data/.simplycop_rspec.yml
CHANGED
@@ -1,9 +1,38 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop-rspec
|
3
3
|
|
4
|
+
RSpec/BeEq:
|
5
|
+
Enabled: true
|
6
|
+
|
4
7
|
RSpec/BeforeAfterAll:
|
5
8
|
Enabled: false
|
6
9
|
|
10
|
+
RSpec/BeNil:
|
11
|
+
Enabled: true
|
12
|
+
|
13
|
+
RSpec/ChangeByZero:
|
14
|
+
Enabled: true
|
15
|
+
|
16
|
+
RSpec/ClassCheck:
|
17
|
+
Enabled: true
|
18
|
+
|
19
|
+
RSpec/Capybara:
|
20
|
+
Enabled: true
|
21
|
+
Include:
|
22
|
+
- spec/integration/*.rb
|
23
|
+
|
24
|
+
RSpec/Capybara/NegationMatcher:
|
25
|
+
Enabled: true
|
26
|
+
|
27
|
+
RSpec/Capybara/SpecificActions:
|
28
|
+
Enabled: true
|
29
|
+
|
30
|
+
RSpec/Capybara/SpecificFinders:
|
31
|
+
Enabled: true
|
32
|
+
|
33
|
+
RSpec/Capybara/SpecificMatcher:
|
34
|
+
Enabled: true
|
35
|
+
|
7
36
|
RSpec/DescribeClass:
|
8
37
|
Enabled: false
|
9
38
|
|
@@ -13,15 +42,34 @@ RSpec/DescribeMethod:
|
|
13
42
|
RSpec/DescribedClass:
|
14
43
|
Enabled: false
|
15
44
|
|
45
|
+
RSpec/DuplicatedMetadata:
|
46
|
+
Enabled: true
|
47
|
+
|
16
48
|
RSpec/ExampleLength:
|
17
49
|
Enabled: false
|
18
50
|
|
51
|
+
RSpec/ExcessiveDocstringSpacing:
|
52
|
+
Enabled: true
|
53
|
+
|
19
54
|
RSpec/ExpectOutput:
|
20
55
|
Enabled: false
|
21
56
|
|
57
|
+
RSpec/FactoryBot/ConsistentParenthesesStyle:
|
58
|
+
Enabled: true
|
59
|
+
|
60
|
+
RSpec/FactoryBot/FactoryNameStyle:
|
61
|
+
Enabled: true
|
62
|
+
|
63
|
+
# Prefer explicit factorybot call
|
64
|
+
RSpec/FactoryBot/SyntaxMethods:
|
65
|
+
Enabled: false
|
66
|
+
|
22
67
|
RSpec/FilePath:
|
23
68
|
Enabled: false
|
24
69
|
|
70
|
+
RSpec/IdenticalEqualityAssertion:
|
71
|
+
Enabled: true
|
72
|
+
|
25
73
|
RSpec/InstanceVariable:
|
26
74
|
Enabled: false
|
27
75
|
|
@@ -38,6 +86,9 @@ RSpec/NestedGroups:
|
|
38
86
|
Enabled: true
|
39
87
|
Max: 4
|
40
88
|
|
89
|
+
RSpec/NoExpectationExample:
|
90
|
+
Enabled: true
|
91
|
+
|
41
92
|
RSpec/NotToNot:
|
42
93
|
Enabled: false
|
43
94
|
|
@@ -47,8 +98,24 @@ RSpec/ScatteredSetup:
|
|
47
98
|
RSpec/StubbedMock:
|
48
99
|
Enabled: false
|
49
100
|
|
101
|
+
RSpec/SortMetadata:
|
102
|
+
Enabled: true
|
103
|
+
|
104
|
+
# Bug https://github.com/rubocop/rubocop-rspec/issues/1521
|
105
|
+
RSpec/PendingWithoutReason:
|
106
|
+
Enabled: false
|
107
|
+
|
50
108
|
RSpec/SubjectDeclaration: # new in 2.5
|
51
109
|
Enabled: true
|
52
110
|
|
53
111
|
RSpec/Rails/AvoidSetupHook: # new in 2.4
|
54
112
|
Enabled: true
|
113
|
+
|
114
|
+
RSpec/Rails/HaveHttpStatus:
|
115
|
+
Enabled: true
|
116
|
+
|
117
|
+
RSpec/Rails/InferredSpecType:
|
118
|
+
Enabled: true
|
119
|
+
|
120
|
+
RSpec/VerifiedDoubleReference:
|
121
|
+
Enabled: true
|
@@ -14,10 +14,10 @@ module CustomCops
|
|
14
14
|
# # good
|
15
15
|
# puts ENV['SOME_KEY']
|
16
16
|
# puts ENVIRON['SOME_KEY']
|
17
|
-
MSG = 'Printing all Environment Variables is extremely risky'\
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
MSG = 'Printing all Environment Variables is extremely risky ' \
|
18
|
+
'If this code has been run, then it is likely that secrets have been ' \
|
19
|
+
'exposed in plaintext. Please alert `#infosec` about this so it can be ' \
|
20
|
+
'investigated immediately.' \
|
21
21
|
|
22
22
|
def_node_matcher :convert_env_to_hash_or_array?, <<~PATTERN
|
23
23
|
(send (const nil? {:ENVIRON :ENV}) {:to_h :to_a :to_hash})
|
@@ -9,10 +9,10 @@ module Security
|
|
9
9
|
source = node.source
|
10
10
|
file_name = node.loc.operator.to_s
|
11
11
|
|
12
|
-
add_offense(node, location: :selector) if found_match(source) &&
|
12
|
+
add_offense(node, location: :selector) if found_match(source) && block_listed?(file_name)
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
15
|
+
def block_listed?(string)
|
16
16
|
RAILS_ENV.each_with_object([]) do |env, results|
|
17
17
|
results << string.include?(env)
|
18
18
|
end.any?(true)
|
data/lib/simplycop/version.rb
CHANGED
data/simplycop.gemspec
CHANGED
@@ -17,9 +17,9 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_dependency 'rubocop', '~> 1.
|
21
|
-
spec.add_dependency 'rubocop-rails', '~> 2.
|
22
|
-
spec.add_dependency 'rubocop-rspec', '~> 2.
|
20
|
+
spec.add_dependency 'rubocop', '~> 1.42'
|
21
|
+
spec.add_dependency 'rubocop-rails', '~> 2.17'
|
22
|
+
spec.add_dependency 'rubocop-rspec', '~> 2.16'
|
23
23
|
spec.add_development_dependency 'bundler', '>= 2.2.15'
|
24
24
|
spec.add_development_dependency 'rake', '>= 12.3.3'
|
25
25
|
spec.add_development_dependency 'rspec', '~> 3.10'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplycop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simply Business
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.42'
|
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: '1.
|
26
|
+
version: '1.42'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubocop-rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '2.
|
33
|
+
version: '2.17'
|
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: '2.
|
40
|
+
version: '2.17'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rubocop-rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '2.
|
47
|
+
version: '2.16'
|
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.16'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|