danger-spm_version_updates 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/danger-spm_version_updates.gemspec +1 -1
- data/lib/spm_version_updates/gem_version.rb +1 -1
- data/lib/spm_version_updates/git.rb +56 -0
- data/lib/spm_version_updates/plugin.rb +14 -102
- data/lib/spm_version_updates/xcode.rb +71 -0
- metadata +4 -29
- data/.editorconfig +0 -15
- data/.github/workflows/docs.yml +0 -43
- data/.github/workflows/lint_and_test.yml +0 -32
- data/.github/workflows/push_gem.yml +0 -26
- data/.github/workflows/readme.yml +0 -21
- data/.gitignore +0 -136
- data/.idea/.gitignore +0 -8
- data/.idea/danger-plugin-spm-version-updates.iml +0 -130
- data/.idea/misc.xml +0 -4
- data/.idea/modules.xml +0 -8
- data/.idea/vcs.xml +0 -6
- data/.markdownlint.jsonc +0 -6
- data/.reek.yml +0 -129
- data/.rubocop.yml +0 -508
- data/spec/spec_helper.rb +0 -61
- data/spec/spm_version_updates_spec.rb +0 -194
- data/spec/support/fixtures/Branch.xcodeproj/project.pbxproj +0 -80
- data/spec/support/fixtures/Branch.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +0 -265
- data/spec/support/fixtures/ExactVersion.xcodeproj/project.pbxproj +0 -80
- data/spec/support/fixtures/ExactVersion.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +0 -265
- data/spec/support/fixtures/NoResolvedVersion.xcodeproj/project.pbxproj +0 -80
- data/spec/support/fixtures/NoResolvedVersion.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +0 -256
- data/spec/support/fixtures/UpToNextMajor.xcodeproj/project.pbxproj +0 -80
- data/spec/support/fixtures/UpToNextMajor.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +0 -265
- data/spec/support/fixtures/VersionRange.xcodeproj/project.pbxproj +0 -81
- data/spec/support/fixtures/VersionRange.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +0 -265
- data/spec/support/fixtures/github_pr.json +0 -268
data/.rubocop.yml
DELETED
@@ -1,508 +0,0 @@
|
|
1
|
-
# Defaults can be found here: https://github.com/bbatsov/rubocop/blob/master/config/default.yml
|
2
|
-
|
3
|
-
require:
|
4
|
-
- rubocop-rspec
|
5
|
-
- rubocop-rake
|
6
|
-
- rubocop-performance
|
7
|
-
|
8
|
-
AllCops:
|
9
|
-
TargetRubyVersion: 3.0
|
10
|
-
NewCops: enable
|
11
|
-
|
12
|
-
Style/MultilineBlockChain:
|
13
|
-
Enabled: false
|
14
|
-
|
15
|
-
Style/MultilineIfModifier:
|
16
|
-
Enabled: false
|
17
|
-
|
18
|
-
Style/TrailingCommaInArrayLiteral:
|
19
|
-
EnforcedStyleForMultiline: consistent_comma
|
20
|
-
|
21
|
-
Style/StderrPuts:
|
22
|
-
Enabled: false
|
23
|
-
|
24
|
-
Style/RegexpLiteral:
|
25
|
-
Enabled: true
|
26
|
-
EnforcedStyle: slashes
|
27
|
-
|
28
|
-
RSpec/ExampleLength:
|
29
|
-
Enabled: false
|
30
|
-
|
31
|
-
RSpec/RepeatedExample:
|
32
|
-
Enabled: false
|
33
|
-
|
34
|
-
Style/BlockDelimiters:
|
35
|
-
Enabled: true
|
36
|
-
EnforcedStyle: always_braces
|
37
|
-
Exclude:
|
38
|
-
- spec/*.rb
|
39
|
-
- Guardfile
|
40
|
-
- Rakefile
|
41
|
-
- danger-*.gemspec
|
42
|
-
|
43
|
-
Metrics/ModuleLength:
|
44
|
-
Enabled: true
|
45
|
-
Exclude:
|
46
|
-
- spec/*.rb
|
47
|
-
|
48
|
-
Layout/ClassStructure:
|
49
|
-
Enabled: true
|
50
|
-
|
51
|
-
Layout/MultilineArrayLineBreaks:
|
52
|
-
Enabled: true
|
53
|
-
|
54
|
-
Layout/MultilineAssignmentLayout:
|
55
|
-
Enabled: true
|
56
|
-
EnforcedStyle: same_line
|
57
|
-
|
58
|
-
Layout/MultilineHashKeyLineBreaks:
|
59
|
-
Enabled: true
|
60
|
-
|
61
|
-
Layout/MultilineMethodArgumentLineBreaks:
|
62
|
-
Enabled: true
|
63
|
-
|
64
|
-
Layout/MultilineMethodParameterLineBreaks:
|
65
|
-
Enabled: true
|
66
|
-
|
67
|
-
Layout/SingleLineBlockChain:
|
68
|
-
Enabled: true
|
69
|
-
|
70
|
-
Style/AutoResourceCleanup:
|
71
|
-
Enabled: true
|
72
|
-
|
73
|
-
Style/CollectionMethods:
|
74
|
-
Enabled: true
|
75
|
-
|
76
|
-
Style/InvertibleUnlessCondition:
|
77
|
-
Enabled: true
|
78
|
-
|
79
|
-
Style/MethodCallWithArgsParentheses:
|
80
|
-
Enabled: true
|
81
|
-
Exclude:
|
82
|
-
- spec/*.rb
|
83
|
-
|
84
|
-
Style/MethodCalledOnDoEndBlock:
|
85
|
-
Enabled: true
|
86
|
-
|
87
|
-
Style/RequireOrder:
|
88
|
-
Enabled: true
|
89
|
-
|
90
|
-
Style/StringMethods:
|
91
|
-
Enabled: true
|
92
|
-
|
93
|
-
Style/TopLevelMethodDefinition:
|
94
|
-
Enabled: true
|
95
|
-
Exclude:
|
96
|
-
- spec/*.rb
|
97
|
-
|
98
|
-
Style/StringLiterals:
|
99
|
-
EnforcedStyle: double_quotes
|
100
|
-
Enabled: true
|
101
|
-
|
102
|
-
# kind_of? is a good way to check a type
|
103
|
-
Style/ClassCheck:
|
104
|
-
EnforcedStyle: kind_of?
|
105
|
-
|
106
|
-
# specs sometimes have useless assignments, which is fine
|
107
|
-
Lint/UselessAssignment:
|
108
|
-
Exclude:
|
109
|
-
- "**/spec/**/*"
|
110
|
-
|
111
|
-
Layout/FirstHashElementIndentation:
|
112
|
-
Enabled: true
|
113
|
-
|
114
|
-
Layout/HashAlignment:
|
115
|
-
Enabled: true
|
116
|
-
|
117
|
-
# HoundCI doesn't like this rule
|
118
|
-
Layout/DotPosition:
|
119
|
-
Enabled: false
|
120
|
-
|
121
|
-
# We allow !! as it's an easy way to convert to boolean
|
122
|
-
Style/DoubleNegation:
|
123
|
-
Enabled: false
|
124
|
-
|
125
|
-
# Cop supports --auto-correct.
|
126
|
-
Lint/UnusedBlockArgument:
|
127
|
-
Enabled: true
|
128
|
-
|
129
|
-
# We want to allow class Fastlane::Class
|
130
|
-
Style/ClassAndModuleChildren:
|
131
|
-
Enabled: false
|
132
|
-
|
133
|
-
Metrics/AbcSize:
|
134
|
-
Max: 60
|
135
|
-
|
136
|
-
# The %w might be confusing for new users
|
137
|
-
Style/WordArray:
|
138
|
-
MinSize: 19
|
139
|
-
|
140
|
-
# raise and fail are both okay
|
141
|
-
Style/SignalException:
|
142
|
-
Enabled: false
|
143
|
-
|
144
|
-
# Having if in the same line might not always be good
|
145
|
-
Style/IfUnlessModifier:
|
146
|
-
Enabled: false
|
147
|
-
|
148
|
-
Style/AndOr:
|
149
|
-
Enabled: true
|
150
|
-
|
151
|
-
# Configuration parameters: CountComments.
|
152
|
-
Metrics/ClassLength:
|
153
|
-
Max: 350
|
154
|
-
|
155
|
-
Metrics/CyclomaticComplexity:
|
156
|
-
Max: 17
|
157
|
-
|
158
|
-
# Configuration parameters: AllowURI, URISchemes.
|
159
|
-
Layout/LineLength:
|
160
|
-
Max: 370
|
161
|
-
|
162
|
-
# Configuration parameters: CountKeywordArgs.
|
163
|
-
Metrics/ParameterLists:
|
164
|
-
Max: 10
|
165
|
-
|
166
|
-
Metrics/PerceivedComplexity:
|
167
|
-
Max: 18
|
168
|
-
|
169
|
-
Style/GuardClause:
|
170
|
-
Enabled: true
|
171
|
-
|
172
|
-
Style/ConditionalAssignment:
|
173
|
-
Enabled: true
|
174
|
-
|
175
|
-
# Better to have too much self than missing a self
|
176
|
-
Style/RedundantSelf:
|
177
|
-
Enabled: false
|
178
|
-
|
179
|
-
Metrics/MethodLength:
|
180
|
-
Max: 60
|
181
|
-
|
182
|
-
# We're not there yet
|
183
|
-
Style/Documentation:
|
184
|
-
Enabled: false
|
185
|
-
|
186
|
-
# Adds complexity
|
187
|
-
Style/IfInsideElse:
|
188
|
-
Enabled: false
|
189
|
-
|
190
|
-
# danger specific
|
191
|
-
|
192
|
-
Style/BlockComments:
|
193
|
-
Enabled: false
|
194
|
-
|
195
|
-
Layout/MultilineMethodCallIndentation:
|
196
|
-
EnforcedStyle: indented
|
197
|
-
|
198
|
-
# FIXME: 25
|
199
|
-
Metrics/BlockLength:
|
200
|
-
Max: 345
|
201
|
-
Exclude:
|
202
|
-
- "**/*_spec.rb"
|
203
|
-
|
204
|
-
Style/MixinGrouping:
|
205
|
-
Enabled: true
|
206
|
-
|
207
|
-
Naming/FileName:
|
208
|
-
Enabled: false
|
209
|
-
|
210
|
-
Layout/HeredocIndentation:
|
211
|
-
Enabled: false
|
212
|
-
|
213
|
-
Style/SpecialGlobalVars:
|
214
|
-
Enabled: false
|
215
|
-
|
216
|
-
Style/PercentLiteralDelimiters:
|
217
|
-
PreferredDelimiters:
|
218
|
-
"%": ()
|
219
|
-
"%i": ()
|
220
|
-
"%q": ()
|
221
|
-
"%Q": ()
|
222
|
-
"%r": "{}"
|
223
|
-
"%s": ()
|
224
|
-
"%w": ()
|
225
|
-
"%W": ()
|
226
|
-
"%x": ()
|
227
|
-
|
228
|
-
Security/YAMLLoad:
|
229
|
-
Enabled: false
|
230
|
-
|
231
|
-
Gemspec/DevelopmentDependencies:
|
232
|
-
Enabled: false
|
233
|
-
|
234
|
-
# This is the default configuration file.
|
235
|
-
|
236
|
-
Performance:
|
237
|
-
Enabled: true
|
238
|
-
|
239
|
-
Performance/AncestorsInclude:
|
240
|
-
Description: "Use `A <= B` instead of `A.ancestors.include?(B)`."
|
241
|
-
Enabled: true
|
242
|
-
|
243
|
-
Performance/ArraySemiInfiniteRangeSlice:
|
244
|
-
Description: "Identifies places where slicing arrays with semi-infinite ranges can be replaced by `Array#take` and `Array#drop`."
|
245
|
-
# This cop was created due to a mistake in microbenchmark.
|
246
|
-
# Refer https://github.com/rubocop/rubocop-performance/pull/175#issuecomment-731892717
|
247
|
-
Enabled: true
|
248
|
-
|
249
|
-
Performance/BigDecimalWithNumericArgument:
|
250
|
-
Description: "Convert numeric literal to string and pass it to `BigDecimal`."
|
251
|
-
Enabled: true
|
252
|
-
|
253
|
-
Performance/BindCall:
|
254
|
-
Description: "Use `bind_call(obj, args, ...)` instead of `bind(obj).call(args, ...)`."
|
255
|
-
Enabled: true
|
256
|
-
|
257
|
-
Performance/BlockGivenWithExplicitBlock:
|
258
|
-
Description: "Check block argument explicitly instead of using `block_given?`."
|
259
|
-
Enabled: true
|
260
|
-
|
261
|
-
Performance/Caller:
|
262
|
-
Description: >-
|
263
|
-
Use `caller(n..n)` instead of `caller`.
|
264
|
-
Enabled: true
|
265
|
-
|
266
|
-
Performance/CaseWhenSplat:
|
267
|
-
Description: >-
|
268
|
-
Reordering `when` conditions with a splat to the end
|
269
|
-
of the `when` branches can improve performance.
|
270
|
-
Enabled: true
|
271
|
-
|
272
|
-
Performance/Casecmp:
|
273
|
-
Description: >-
|
274
|
-
Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, or `== upcase`..
|
275
|
-
Reference: "https://github.com/fastruby/fast-ruby#stringcasecmp-vs--stringcasecmp-vs-stringdowncase---code"
|
276
|
-
Enabled: true
|
277
|
-
|
278
|
-
Performance/ChainArrayAllocation:
|
279
|
-
Description: >-
|
280
|
-
Instead of chaining array methods that allocate new arrays, mutate an
|
281
|
-
existing array.
|
282
|
-
Reference: "https://twitter.com/schneems/status/1034123879978029057"
|
283
|
-
Enabled: true
|
284
|
-
Exclude:
|
285
|
-
- spec/*.rb
|
286
|
-
|
287
|
-
Performance/CollectionLiteralInLoop:
|
288
|
-
Description: "Extract Array and Hash literals outside of loops into local variables or constants."
|
289
|
-
Enabled: true
|
290
|
-
|
291
|
-
Performance/CompareWithBlock:
|
292
|
-
Description: "Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`."
|
293
|
-
Enabled: true
|
294
|
-
|
295
|
-
Performance/ConcurrentMonotonicTime:
|
296
|
-
Description: "Use `Process.clock_gettime(Process::CLOCK_MONOTONIC)` instead of `Concurrent.monotonic_time`."
|
297
|
-
Reference: "https://github.com/rails/rails/pull/43502"
|
298
|
-
Enabled: true
|
299
|
-
|
300
|
-
Performance/ConstantRegexp:
|
301
|
-
Description: "Finds regular expressions with dynamic components that are all constants."
|
302
|
-
Enabled: true
|
303
|
-
|
304
|
-
Performance/Count:
|
305
|
-
Description: >-
|
306
|
-
Use `count` instead of `{select,find_all,filter,reject}...{size,count,length}`.
|
307
|
-
# This cop has known compatibility issues with `ActiveRecord` and other
|
308
|
-
# frameworks. ActiveRecord's `count` ignores the block that is passed to it.
|
309
|
-
# For more information, see the documentation in the cop itself.
|
310
|
-
Enabled: true
|
311
|
-
|
312
|
-
Performance/DeletePrefix:
|
313
|
-
Description: "Use `delete_prefix` instead of `gsub`."
|
314
|
-
Enabled: true
|
315
|
-
|
316
|
-
Performance/DeleteSuffix:
|
317
|
-
Description: "Use `delete_suffix` instead of `gsub`."
|
318
|
-
Enabled: true
|
319
|
-
|
320
|
-
Performance/Detect:
|
321
|
-
Description: >-
|
322
|
-
Use `detect` instead of `select.first`, `find_all.first`, `filter.first`,
|
323
|
-
`select.last`, `find_all.last`, and `filter.last`.
|
324
|
-
Reference: "https://github.com/fastruby/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code"
|
325
|
-
# This cop has known compatibility issues with `ActiveRecord` and other
|
326
|
-
# frameworks. `ActiveRecord` does not implement a `detect` method and `find`
|
327
|
-
# has its own meaning. Correcting `ActiveRecord` methods with this cop
|
328
|
-
# should be considered unsafe.
|
329
|
-
Enabled: true
|
330
|
-
|
331
|
-
Performance/DoubleStartEndWith:
|
332
|
-
Description: >-
|
333
|
-
Use `str.{start,end}_with?(x, ..., y, ...)`
|
334
|
-
instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
|
335
|
-
Enabled: true
|
336
|
-
|
337
|
-
Performance/EndWith:
|
338
|
-
Description: "Use `end_with?` instead of a regex match anchored to the end of a string."
|
339
|
-
Reference: "https://github.com/fastruby/fast-ruby#stringmatch-vs-stringmatch-vs-stringstart_withstringend_with-code-start-code-end"
|
340
|
-
# This will change to a new method call which isn't guaranteed to be on the
|
341
|
-
# object. Switching these methods has to be done with knowledge of the types
|
342
|
-
# of the variables which rubocop doesn't have.
|
343
|
-
Enabled: true
|
344
|
-
|
345
|
-
Performance/FixedSize:
|
346
|
-
Description: "Do not compute the size of statically sized objects except in constants."
|
347
|
-
Enabled: true
|
348
|
-
|
349
|
-
Performance/FlatMap:
|
350
|
-
Description: >-
|
351
|
-
Use `Enumerable#flat_map`
|
352
|
-
instead of `Enumerable#map...Array#flatten(1)`
|
353
|
-
or `Enumerable#collect..Array#flatten(1)`.
|
354
|
-
Reference: "https://github.com/fastruby/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code"
|
355
|
-
Enabled: true
|
356
|
-
EnabledForFlattenWithoutParams: false
|
357
|
-
# If enabled, this cop will warn about usages of
|
358
|
-
# `flatten` being called without any parameters.
|
359
|
-
# This can be dangerous since `flat_map` will only flatten 1 level, and
|
360
|
-
# `flatten` without any parameters can flatten multiple levels.
|
361
|
-
|
362
|
-
Performance/InefficientHashSearch:
|
363
|
-
Description: "Use `key?` or `value?` instead of `keys.include?` or `values.include?`."
|
364
|
-
Reference: "https://github.com/fastruby/fast-ruby#hashkey-instead-of-hashkeysinclude-code"
|
365
|
-
Enabled: true
|
366
|
-
|
367
|
-
Performance/IoReadlines:
|
368
|
-
Description: "Use `IO.each_line` (`IO#each_line`) instead of `IO.readlines` (`IO#readlines`)."
|
369
|
-
Reference: "https://docs.gitlab.com/ee/development/performance.html#reading-from-files-and-other-data-sources"
|
370
|
-
Enabled: true
|
371
|
-
|
372
|
-
Performance/MapCompact:
|
373
|
-
Description: "Use `filter_map` instead of `collection.map(&:do_something).compact`."
|
374
|
-
Enabled: true
|
375
|
-
|
376
|
-
Performance/MapMethodChain:
|
377
|
-
Description: "Checks if the `map` method is used in a chain."
|
378
|
-
Enabled: true
|
379
|
-
|
380
|
-
Performance/MethodObjectAsBlock:
|
381
|
-
Description: "Use block explicitly instead of block-passing a method object."
|
382
|
-
Reference: "https://github.com/fastruby/fast-ruby#normal-way-to-apply-method-vs-method-code"
|
383
|
-
Enabled: true
|
384
|
-
|
385
|
-
Performance/OpenStruct:
|
386
|
-
Description: "Use `Struct` instead of `OpenStruct`."
|
387
|
-
Enabled: true
|
388
|
-
|
389
|
-
Performance/RangeInclude:
|
390
|
-
Description: "Use `Range#cover?` instead of `Range#include?` (or `Range#member?`)."
|
391
|
-
Reference: "https://github.com/fastruby/fast-ruby#cover-vs-include-code"
|
392
|
-
Enabled: true
|
393
|
-
|
394
|
-
Performance/RedundantBlockCall:
|
395
|
-
Description: "Use `yield` instead of `block.call`."
|
396
|
-
Reference: "https://github.com/fastruby/fast-ruby#proccall-and-block-arguments-vs-yieldcode"
|
397
|
-
Enabled: true
|
398
|
-
|
399
|
-
Performance/RedundantEqualityComparisonBlock:
|
400
|
-
Description: >-
|
401
|
-
Checks for uses `Enumerable#all?`, `Enumerable#any?`, `Enumerable#one?`,
|
402
|
-
or `Enumerable#none?` are compared with `===` or similar methods in block.
|
403
|
-
Reference: "https://github.com/rails/rails/pull/41363"
|
404
|
-
Enabled: true
|
405
|
-
|
406
|
-
Performance/RedundantMatch:
|
407
|
-
Description: >-
|
408
|
-
Use `=~` instead of `String#match` or `Regexp#match` in a context where the
|
409
|
-
returned `MatchData` is not needed.
|
410
|
-
Enabled: true
|
411
|
-
|
412
|
-
Performance/RedundantMerge:
|
413
|
-
Description: "Use Hash#[]=, rather than Hash#merge! with a single key-value pair."
|
414
|
-
Reference: "https://github.com/fastruby/fast-ruby#hashmerge-vs-hash-code"
|
415
|
-
Enabled: true
|
416
|
-
# Max number of key-value pairs to consider an offense
|
417
|
-
MaxKeyValuePairs: 2
|
418
|
-
|
419
|
-
Performance/RedundantSortBlock:
|
420
|
-
Description: "Use `sort` instead of `sort { |a, b| a <=> b }`."
|
421
|
-
Enabled: true
|
422
|
-
|
423
|
-
Performance/RedundantSplitRegexpArgument:
|
424
|
-
Description: "Identifies places where `split` argument can be replaced from a deterministic regexp to a string."
|
425
|
-
Enabled: true
|
426
|
-
|
427
|
-
Performance/RedundantStringChars:
|
428
|
-
Description: "Checks for redundant `String#chars`."
|
429
|
-
Enabled: true
|
430
|
-
|
431
|
-
Performance/RegexpMatch:
|
432
|
-
Description: >-
|
433
|
-
Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`,
|
434
|
-
`Regexp#===`, or `=~` when `MatchData` is not used.
|
435
|
-
Reference: "https://github.com/fastruby/fast-ruby#regexp-vs-regexpmatch-vs-regexpmatch-vs-stringmatch-vs-string-vs-stringmatch-code-"
|
436
|
-
Enabled: true
|
437
|
-
|
438
|
-
Performance/ReverseEach:
|
439
|
-
Description: "Use `reverse_each` instead of `reverse.each`."
|
440
|
-
Reference: "https://github.com/fastruby/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code"
|
441
|
-
Enabled: true
|
442
|
-
|
443
|
-
Performance/ReverseFirst:
|
444
|
-
Description: "Use `last(n).reverse` instead of `reverse.first(n)`."
|
445
|
-
Enabled: true
|
446
|
-
|
447
|
-
Performance/SelectMap:
|
448
|
-
Description: "Use `filter_map` instead of `ary.select(&:foo).map(&:bar)`."
|
449
|
-
Enabled: true
|
450
|
-
|
451
|
-
Performance/Size:
|
452
|
-
Description: >-
|
453
|
-
Use `size` instead of `count` for counting
|
454
|
-
the number of elements in `Array` and `Hash`.
|
455
|
-
Reference: "https://github.com/fastruby/fast-ruby#arraylength-vs-arraysize-vs-arraycount-code"
|
456
|
-
Enabled: true
|
457
|
-
|
458
|
-
Performance/SortReverse:
|
459
|
-
Description: "Use `sort.reverse` instead of `sort { |a, b| b <=> a }`."
|
460
|
-
Enabled: true
|
461
|
-
|
462
|
-
Performance/Squeeze:
|
463
|
-
Description: "Use `squeeze('a')` instead of `gsub(/a+/, 'a')`."
|
464
|
-
Reference: "https://github.com/fastruby/fast-ruby#remove-extra-spaces-or-other-contiguous-characters-code"
|
465
|
-
Enabled: true
|
466
|
-
|
467
|
-
Performance/StartWith:
|
468
|
-
Description: "Use `start_with?` instead of a regex match anchored to the beginning of a string."
|
469
|
-
Reference: "https://github.com/fastruby/fast-ruby#stringmatch-vs-stringmatch-vs-stringstart_withstringend_with-code-start-code-end"
|
470
|
-
# This will change to a new method call which isn't guaranteed to be on the
|
471
|
-
# object. Switching these methods has to be done with knowledge of the types
|
472
|
-
# of the variables which rubocop doesn't have.
|
473
|
-
Enabled: true
|
474
|
-
SafeMultiline: true
|
475
|
-
|
476
|
-
Performance/StringIdentifierArgument:
|
477
|
-
Description: "Use symbol identifier argument instead of string identifier argument."
|
478
|
-
Enabled: true
|
479
|
-
|
480
|
-
Performance/StringInclude:
|
481
|
-
Description: "Use `String#include?` instead of a regex match with literal-only pattern."
|
482
|
-
Enabled: true
|
483
|
-
|
484
|
-
Performance/StringReplacement:
|
485
|
-
Description: >-
|
486
|
-
Use `tr` instead of `gsub` when you are replacing the same
|
487
|
-
number of characters. Use `delete` instead of `gsub` when
|
488
|
-
you are deleting characters.
|
489
|
-
Reference: "https://github.com/fastruby/fast-ruby#stringgsub-vs-stringtr-code"
|
490
|
-
Enabled: true
|
491
|
-
|
492
|
-
Performance/Sum:
|
493
|
-
Description: "Use `sum` instead of a custom array summation."
|
494
|
-
Reference: "https://blog.bigbinary.com/2016/11/02/ruby-2-4-introduces-enumerable-sum.html"
|
495
|
-
Enabled: true
|
496
|
-
|
497
|
-
Performance/TimesMap:
|
498
|
-
Description: "Checks for .times.map calls."
|
499
|
-
Enabled: true
|
500
|
-
# See https://github.com/rubocop/rubocop/issues/4658
|
501
|
-
|
502
|
-
Performance/UnfreezeString:
|
503
|
-
Description: "Use unary plus to get an unfrozen string literal."
|
504
|
-
Enabled: true
|
505
|
-
|
506
|
-
Performance/UriDefaultParser:
|
507
|
-
Description: "Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`."
|
508
|
-
Enabled: true
|
data/spec/spec_helper.rb
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "pathname"
|
4
|
-
ROOT = Pathname.new(File.expand_path("..", __dir__))
|
5
|
-
$:.unshift("#{ROOT}lib".to_s)
|
6
|
-
$:.unshift("#{ROOT}spec".to_s)
|
7
|
-
|
8
|
-
require "bundler/setup"
|
9
|
-
require "pry"
|
10
|
-
|
11
|
-
require "danger"
|
12
|
-
require "rspec"
|
13
|
-
|
14
|
-
# Use coloured output, it's the best.
|
15
|
-
RSpec.configure do |config|
|
16
|
-
config.filter_gems_from_backtrace("bundler")
|
17
|
-
config.color = true
|
18
|
-
config.tty = true
|
19
|
-
end
|
20
|
-
|
21
|
-
require "danger_plugin"
|
22
|
-
|
23
|
-
# These functions are a subset of https://github.com/danger/danger/blob/master/spec/spec_helper.rb
|
24
|
-
# If you are expanding these files, see if it's already been done ^.
|
25
|
-
|
26
|
-
# A silent version of the user interface,
|
27
|
-
# it comes with an extra function `.string` which will
|
28
|
-
# strip all ANSI colours from the string.
|
29
|
-
|
30
|
-
# rubocop:disable Lint/NestedMethodDefinition
|
31
|
-
def testing_ui
|
32
|
-
@output = StringIO.new
|
33
|
-
def @output.winsize
|
34
|
-
[20, 9999]
|
35
|
-
end
|
36
|
-
|
37
|
-
cork = Cork::Board.new(out: @output)
|
38
|
-
def cork.string
|
39
|
-
out.string.gsub(/\e\[([;\d]+)?m/, "")
|
40
|
-
end
|
41
|
-
cork
|
42
|
-
end
|
43
|
-
# rubocop:enable Lint/NestedMethodDefinition
|
44
|
-
|
45
|
-
# Example environment (ENV) that would come from
|
46
|
-
# running a PR on TravisCI
|
47
|
-
def testing_env
|
48
|
-
{
|
49
|
-
"HAS_JOSH_K_SEAL_OF_APPROVAL" => "true",
|
50
|
-
"TRAVIS_PULL_REQUEST" => "800",
|
51
|
-
"TRAVIS_REPO_SLUG" => "artsy/eigen",
|
52
|
-
"TRAVIS_COMMIT_RANGE" => "759adcbd0d8f...13c4dc8bb61d",
|
53
|
-
"DANGER_GITHUB_API_TOKEN" => "123sbdq54erfsd3422gdfio"
|
54
|
-
}
|
55
|
-
end
|
56
|
-
|
57
|
-
# A stubbed out Dangerfile for use in tests
|
58
|
-
def testing_dangerfile
|
59
|
-
env = Danger::EnvironmentManager.new(testing_env)
|
60
|
-
Danger::Dangerfile.new(env, testing_ui)
|
61
|
-
end
|