simplycop 1.12.11 → 1.12.13

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
2
  SHA256:
3
- metadata.gz: b4f0037507c93720c3290f662ab00d85da6853f1e04a56f536181c52f1de11aa
4
- data.tar.gz: 9e7e65ffa5ca97f135691c74f913c919ffe5ea885185b8b5d233778479fde7f0
3
+ metadata.gz: 7bcd75c07282d6105cb8cb92d7bce94f45c15d39f267bf728cd865eb83db72b6
4
+ data.tar.gz: 989276d266d83938c63b3106b868ae155ddf62dd24d53ed6eefb46c0d48b7318
5
5
  SHA512:
6
- metadata.gz: f2f404919d9cd8bd20099854b4164676e48d20c6142b091b71ac864db6bee65d405f6f39a08977292cbb9703ddafc26e8fa28e10667a5b4869aab9cdb54f9695
7
- data.tar.gz: 35333a7faa3778d97c3f5c21450107c6206905dee3b35512ff35cf505db11827ceed1f4aa5d0bb26773dfdd9c53f7ee52d95c45bbfa37db6150fed153a142b06
6
+ metadata.gz: c61acf3adf95dd5264021d1ad8cb02f5eb413e2a61fd1bd038d27cec7fe1b2f649636a7915b055dea263feac315b8e0ddca8bf3bc990bd675d7366a48bfd4ac8
7
+ data.tar.gz: a7d64eea7f27910436e7efb3687d4bbac219ab6fd5dd519402d3ad11f90834f568720a194084b4c1b3c28ad019b43da5a84c9304afe9ba2468f4378efdccc0d7
@@ -12,7 +12,7 @@ permissions:
12
12
 
13
13
  jobs:
14
14
  build:
15
- runs-on: ubuntu-18.04
15
+ runs-on: ubuntu-latest
16
16
  defaults:
17
17
  run:
18
18
  working-directory: ./
@@ -9,7 +9,7 @@ permissions:
9
9
  jobs:
10
10
  build:
11
11
  name: Build and Publish
12
- runs-on: ubuntu-18.04
12
+ runs-on: ubuntu-latest
13
13
  steps:
14
14
  - uses: actions/checkout@v3
15
15
  - name: Set up Ruby 3.0
@@ -11,7 +11,7 @@ permissions:
11
11
  statuses: write
12
12
  jobs:
13
13
  build:
14
- runs-on: ubuntu-18.04
14
+ runs-on: ubuntu-latest
15
15
 
16
16
  steps:
17
17
  - uses: simplybusiness/version-forget-me-not@v2.3.0
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
 
@@ -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
- ' 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.'\
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) && black_listed?(file_name)
12
+ add_offense(node, location: :selector) if found_match(source) && block_listed?(file_name)
13
13
  end
14
14
 
15
- def black_listed?(string)
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)
@@ -7,5 +7,5 @@
7
7
  #
8
8
 
9
9
  module Simplycop
10
- VERSION = '1.12.11'
10
+ VERSION = '1.12.13'
11
11
  end
data/simplycop.gemspec CHANGED
@@ -17,7 +17,7 @@ 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.35'
20
+ spec.add_dependency 'rubocop', '~> 1.42'
21
21
  spec.add_dependency 'rubocop-rails', '~> 2.15'
22
22
  spec.add_dependency 'rubocop-rspec', '~> 2.12'
23
23
  spec.add_development_dependency 'bundler', '>= 2.2.15'
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.11
4
+ version: 1.12.13
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-02-14 00:00:00.000000000 Z
11
+ date: 2023-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.35'
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.35'
26
+ version: '1.42'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop-rails
29
29
  requirement: !ruby/object:Gem::Requirement