danger-spm_version_updates 0.1.1 → 0.1.3

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