dependabot-swift 0.393.0 → 0.394.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e00ccec6ddd544f4f22c09938a9c1da9c8417075b47d6e4eb73cf0180b295bb
4
- data.tar.gz: a90680a12b1dcc7c9f4eb39495de35964337ea3f8bbc2d986880101b15664160
3
+ metadata.gz: 73117d0984f5d33a5ffd3fb8d1b57eb286d3264284817e010a50806432c720f6
4
+ data.tar.gz: 6fae8e03f802a1546a493782db38fe164e23ab103777aa4415fad1e2ed409b5c
5
5
  SHA512:
6
- metadata.gz: 3180f0538499b7b2829f66797dd1630c5bcf89efc2169f11237b191c93b975e3fedd86e76d88f299fe5423ab3cc660f39dbdfe877131db1d252024795b671ec4
7
- data.tar.gz: fb75ad4ce85c4b70e2f3abd674e19fbe57367ed2252b1daea9fe0960ec870e83a9b0dedc2927b1772514107ad0ca6e7d368424a293c090c2b704367ddc7fd47c
6
+ metadata.gz: 595ebab9da23800da9fdab84dcf1969f240dbfa685c59664f70580f022ecc3da40a32f0480382cd9f8245b90c660a32417a58d4cbea396abdfb5e69daf9e5ceb
7
+ data.tar.gz: 24e209043401a8eddf2626bcd70d4e9904cb662a40f87f826c01c540ccc92fb8a5da75beabc65b1ce6dd24d5d1d78ec11d209acd7f1f93885c6991e5f617dc8d
@@ -12,9 +12,26 @@ module Dependabot
12
12
  extend T::Sig
13
13
  extend T::Helpers
14
14
 
15
+ # An optional `name:` label may precede the `url:` argument.
16
+ NAME_ARGUMENT = /(?:name:\s+"[^"]+",\s*)?/
17
+
18
+ # The `url:` argument identifies the dependency's source.
19
+ URL_ARGUMENT = /url:\s+"(?<url>[^"]+)",\s*/
20
+
21
+ # The version requirement (e.g. `from: "1.0.0"`, `.upToNextMajor(from: "1.0.0")`, a range).
22
+ REQUIREMENT_ARGUMENT = /(?<requirement>#{NativeRequirement::REGEXP})/
23
+
24
+ # A single additional labeled argument (e.g. `traits: []`) whose value may be an array, a
25
+ # string, or a bare token. The leading comma is optional so the final argument matches too.
26
+ TRAILING_ARGUMENT = /\s*,?\s*\w+\s*:\s*(?:\[[^\]]*\]|"[^"]*"|[^\s,)]+)/
27
+
28
+ # After the requirement there may be any number of trailing arguments (which can span onto
29
+ # following lines) before the closing `)`, optionally followed by a trailing comma.
30
+ TRAILING_ARGUMENTS = /(?:#{TRAILING_ARGUMENT})*\s*,?\s*/
31
+
15
32
  DEPENDENCY =
16
33
  /(?<declaration>\.package\(\s*
17
- (?:name:\s+"[^"]+",\s*)?url:\s+"(?<url>[^"]+)",\s*(?<requirement>#{NativeRequirement::REGEXP})\s*
34
+ #{NAME_ARGUMENT}#{URL_ARGUMENT}#{REQUIREMENT_ARGUMENT}#{TRAILING_ARGUMENTS}
18
35
  \))/x
19
36
 
20
37
  sig do
@@ -28,12 +28,23 @@ module Dependabot
28
28
  sig { returns(String) }
29
29
  def updated_content
30
30
  content.gsub(declaration) do |match|
31
- match.to_s.sub(old_requirement, new_requirement)
31
+ match.to_s.sub(old_requirement, replacement)
32
32
  end
33
33
  end
34
34
 
35
35
  private
36
36
 
37
+ # The parser captures a trailing comma separating the requirement from a following
38
+ # argument on the next line. Carry it over when the replacement doesn't already have
39
+ # one, so multi-line declarations stay valid.
40
+ sig { returns(String) }
41
+ def replacement
42
+ return new_requirement unless old_requirement.end_with?(",")
43
+ return new_requirement if new_requirement.end_with?(",")
44
+
45
+ "#{new_requirement},"
46
+ end
47
+
37
48
  sig { returns(String) }
38
49
  attr_reader :content
39
50
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-swift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.393.0
4
+ version: 0.394.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.393.0
18
+ version: 0.394.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.393.0
25
+ version: 0.394.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: debug
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -169,14 +169,14 @@ dependencies:
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: '0.22'
172
+ version: '1.1'
173
173
  type: :development
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: '0.22'
179
+ version: '1.1'
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: turbo_tests
182
182
  requirement: !ruby/object:Gem::Requirement
@@ -272,7 +272,7 @@ licenses:
272
272
  - MIT
273
273
  metadata:
274
274
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
275
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.393.0
275
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.394.0
276
276
  rdoc_options: []
277
277
  require_paths:
278
278
  - lib