dependabot-sbt 0.390.0 → 0.391.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 +4 -4
- data/lib/dependabot/sbt/file_fetcher.rb +1 -1
- data/lib/dependabot/sbt/file_parser/property_value_finder.rb +2 -5
- data/lib/dependabot/sbt/file_parser/repositories_finder.rb +6 -18
- data/lib/dependabot/sbt/file_parser.rb +14 -32
- data/lib/dependabot/sbt/file_updater.rb +37 -40
- data/lib/dependabot/sbt/package/package_details_fetcher.rb +4 -4
- data/lib/dependabot/sbt/requirement.rb +2 -2
- data/lib/dependabot/sbt/update_checker/requirements_updater.rb +5 -4
- data/lib/dependabot/sbt/update_checker.rb +9 -9
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 78259b05fed1ee05bac16119e0d128fa9f015f5714b3021f154e94bfe0bb1749
|
|
4
|
+
data.tar.gz: 4f9cfe14ace89b6684ccec6cb7d26077b598a0a99478b78d1655561146580c75
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 579e6171ebc1a87d544fb5bed7d4d4faf1210eb82b88da50dc8fe16df75943801d1d5de2ad69c0ad266b68885865144a4b043ffc93b0a2e52dc5914b36242a64
|
|
7
|
+
data.tar.gz: 45a61970aaada52e31be1e621b06d1de3c22f1e6fe186a61d243dea1934a80daa8ca14a827a36673d89d10407e54c675980dca157c69a6d9e57527d32e00267a
|
|
@@ -17,7 +17,7 @@ module Dependabot
|
|
|
17
17
|
PLUGINS_SBT_FILENAME = "project/plugins.sbt"
|
|
18
18
|
BUILD_PROPERTIES_FILENAME = "project/build.properties"
|
|
19
19
|
# Directories that are part of the SBT build structure, not subprojects
|
|
20
|
-
NON_SUBPROJECT_DIRS =
|
|
20
|
+
NON_SUBPROJECT_DIRS = %w(project target .git .github).freeze
|
|
21
21
|
|
|
22
22
|
sig { override.params(filenames: T::Array[String]).returns(T::Boolean) }
|
|
23
23
|
def self.required_files_in?(filenames)
|
|
@@ -17,14 +17,11 @@ module Dependabot
|
|
|
17
17
|
# Matches: val someVersion = "1.2.3"
|
|
18
18
|
# Also: val someVersion: String = "1.2.3"
|
|
19
19
|
# Also: lazy val someVersion = "1.2.3"
|
|
20
|
-
VAL_DECLARATION_REGEX =
|
|
21
|
-
/(?:^|\s)(?:lazy\s+)?val\s+(?<name>\w+)(?:\s*:\s*String)?\s*=\s*"(?<value>[^"]+)"/,
|
|
22
|
-
Regexp
|
|
23
|
-
)
|
|
20
|
+
VAL_DECLARATION_REGEX = /(?:^|\s)(?:lazy\s+)?val\s+(?<name>\w+)(?:\s*:\s*String)?\s*=\s*"(?<value>[^"]+)"/
|
|
24
21
|
|
|
25
22
|
sig { params(dependency_files: T::Array[Dependabot::DependencyFile]).void }
|
|
26
23
|
def initialize(dependency_files:)
|
|
27
|
-
@dependency_files =
|
|
24
|
+
@dependency_files = dependency_files
|
|
28
25
|
@properties = T.let({}, T::Hash[String, T::Hash[String, T::Hash[Symbol, String]]])
|
|
29
26
|
end
|
|
30
27
|
|
|
@@ -14,28 +14,16 @@ module Dependabot
|
|
|
14
14
|
CENTRAL_REPO_URL = "https://repo.maven.apache.org/maven2"
|
|
15
15
|
|
|
16
16
|
# Matches: resolvers += "Name" at "https://url"
|
|
17
|
-
RESOLVER_AT_REGEX =
|
|
18
|
-
/resolvers\s*\+?=\s*(?:Seq\s*\()?\s*"[^"]*"\s+at\s+"(?<url>[^"]+)"/,
|
|
19
|
-
Regexp
|
|
20
|
-
)
|
|
17
|
+
RESOLVER_AT_REGEX = /resolvers\s*\+?=\s*(?:Seq\s*\()?\s*"[^"]*"\s+at\s+"(?<url>[^"]+)"/
|
|
21
18
|
|
|
22
19
|
# Matches: resolvers ++= Seq("Name" at "url", ...)
|
|
23
|
-
RESOLVER_SEQ_AT_REGEX =
|
|
24
|
-
/"[^"]*"\s+at\s+"(?<url>[^"]+)"/,
|
|
25
|
-
Regexp
|
|
26
|
-
)
|
|
20
|
+
RESOLVER_SEQ_AT_REGEX = /"[^"]*"\s+at\s+"(?<url>[^"]+)"/
|
|
27
21
|
|
|
28
22
|
# Matches: Resolver.url("name", url("https://url"))
|
|
29
|
-
RESOLVER_URL_REGEX =
|
|
30
|
-
/Resolver\.url\(\s*"[^"]*"\s*,\s*url\(\s*"(?<url>[^"]+)"\s*\)/,
|
|
31
|
-
Regexp
|
|
32
|
-
)
|
|
23
|
+
RESOLVER_URL_REGEX = /Resolver\.url\(\s*"[^"]*"\s*,\s*url\(\s*"(?<url>[^"]+)"\s*\)/
|
|
33
24
|
|
|
34
25
|
# Matches: MavenRepository("name", "https://url")
|
|
35
|
-
MAVEN_REPOSITORY_REGEX =
|
|
36
|
-
/MavenRepository\(\s*"[^"]*"\s*,\s*"(?<url>[^"]+)"\s*\)/,
|
|
37
|
-
Regexp
|
|
38
|
-
)
|
|
26
|
+
MAVEN_REPOSITORY_REGEX = /MavenRepository\(\s*"[^"]*"\s*,\s*"(?<url>[^"]+)"\s*\)/
|
|
39
27
|
|
|
40
28
|
sig do
|
|
41
29
|
params(
|
|
@@ -44,8 +32,8 @@ module Dependabot
|
|
|
44
32
|
).void
|
|
45
33
|
end
|
|
46
34
|
def initialize(dependency_files:, credentials: [])
|
|
47
|
-
@dependency_files =
|
|
48
|
-
@credentials =
|
|
35
|
+
@dependency_files = dependency_files
|
|
36
|
+
@credentials = credentials
|
|
49
37
|
end
|
|
50
38
|
|
|
51
39
|
sig { returns(T::Array[String]) }
|
|
@@ -24,56 +24,38 @@ module Dependabot
|
|
|
24
24
|
BUILD_PROPERTIES_FILENAME = "project/build.properties"
|
|
25
25
|
|
|
26
26
|
# Matches a simple identifier or dotted reference (e.g. myVal, V.scala212)
|
|
27
|
-
IDENT_OR_DOTTED =
|
|
28
|
-
"[a-zA-Z_]\\w*(?:\\.[a-zA-Z_]\\w*)*",
|
|
29
|
-
String
|
|
30
|
-
)
|
|
27
|
+
IDENT_OR_DOTTED = "[a-zA-Z_]\\w*(?:\\.[a-zA-Z_]\\w*)*"
|
|
31
28
|
|
|
32
29
|
# "org" % "artifact" % "version" or "org" %% "artifact" % "version"
|
|
33
30
|
# Optionally followed by % "scope" (e.g. % "test", % "provided")
|
|
34
|
-
LIBRARY_DEP_REGEX =
|
|
35
|
-
/"(?<group>[^"]+)"\s+(?<op>%%?)\s+"(?<artifact>[^"]+)"\s+%\s+"(?<version>[^"]+)"(?:\s+%\s+"[^"]*")
|
|
36
|
-
Regexp
|
|
37
|
-
)
|
|
31
|
+
LIBRARY_DEP_REGEX =
|
|
32
|
+
/"(?<group>[^"]+)"\s+(?<op>%%?)\s+"(?<artifact>[^"]+)"\s+%\s+"(?<version>[^"]+)"(?:\s+%\s+"[^"]*")*/
|
|
38
33
|
|
|
39
34
|
# "org" % "artifact" % valName or "org" %% "artifact" % valName
|
|
40
35
|
# Also handles dotted references like Object.member
|
|
41
|
-
VAL_REF_DEP_REGEX =
|
|
42
|
-
/"(?<group>[^"]+)"\s+(?<op>%%?)\s+"(?<artifact>[^"]+)"\s+%\s+(?<val_name>[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)
|
|
43
|
-
Regexp
|
|
44
|
-
)
|
|
36
|
+
VAL_REF_DEP_REGEX =
|
|
37
|
+
/"(?<group>[^"]+)"\s+(?<op>%%?)\s+"(?<artifact>[^"]+)"\s+%\s+(?<val_name>[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)/
|
|
45
38
|
|
|
46
39
|
# addSbtPlugin("org" % "name" % "version")
|
|
47
|
-
PLUGIN_DEP_REGEX =
|
|
48
|
-
/addSbtPlugin\(\s*"(?<group>[^"]+)"\s+%\s+"(?<artifact>[^"]+)"\s+%\s+"(?<version>[^"]+)"\s*\)
|
|
49
|
-
Regexp
|
|
50
|
-
)
|
|
40
|
+
PLUGIN_DEP_REGEX =
|
|
41
|
+
/addSbtPlugin\(\s*"(?<group>[^"]+)"\s+%\s+"(?<artifact>[^"]+)"\s+%\s+"(?<version>[^"]+)"\s*\)/
|
|
51
42
|
|
|
52
43
|
# addSbtPlugin("org" % "name" % valName)
|
|
53
44
|
# Also handles dotted references like Object.member
|
|
54
|
-
PLUGIN_VAL_REF_REGEX =
|
|
55
|
-
/addSbtPlugin\(\s*"(?<group>[^"]+)"\s+%\s+"(?<artifact>[^"]+)"\s+%\s+(?<val_name>#{IDENT_OR_DOTTED})\s*\)
|
|
56
|
-
Regexp
|
|
57
|
-
)
|
|
45
|
+
PLUGIN_VAL_REF_REGEX =
|
|
46
|
+
/addSbtPlugin\(\s*"(?<group>[^"]+)"\s+%\s+"(?<artifact>[^"]+)"\s+%\s+(?<val_name>#{IDENT_OR_DOTTED})\s*\)/
|
|
58
47
|
|
|
59
48
|
# sbt.version=1.x.y in build.properties
|
|
60
|
-
SBT_VERSION_REGEX =
|
|
61
|
-
/\Asbt\.version\s*=\s*(?<version>.+)\z/,
|
|
62
|
-
Regexp
|
|
63
|
-
)
|
|
49
|
+
SBT_VERSION_REGEX = /\Asbt\.version\s*=\s*(?<version>.+)\z/
|
|
64
50
|
|
|
65
51
|
# scalaVersion := "2.13.12" or ThisBuild / scalaVersion := "2.13.12"
|
|
66
52
|
# Also: scalaVersion in ThisBuild := "2.13.12" (older SBT syntax)
|
|
67
|
-
SCALA_VERSION_REGEX =
|
|
68
|
-
%r{(?:ThisBuild\s*/\s*)?(?:scalaVersion\s+in\s+ThisBuild|scalaVersion)\s*:=\s*"(?<version>[^"]+)"}
|
|
69
|
-
Regexp
|
|
70
|
-
)
|
|
53
|
+
SCALA_VERSION_REGEX =
|
|
54
|
+
%r{(?:ThisBuild\s*/\s*)?(?:scalaVersion\s+in\s+ThisBuild|scalaVersion)\s*:=\s*"(?<version>[^"]+)"}
|
|
71
55
|
|
|
72
56
|
# scalaVersion := valRef or scalaVersion in ThisBuild := V.scala212
|
|
73
|
-
SCALA_VERSION_VAL_REGEX =
|
|
74
|
-
%r{(?:ThisBuild\s*/\s*)?(?:scalaVersion\s+in\s+ThisBuild|scalaVersion)\s*:=\s*(?<val_name>#{IDENT_OR_DOTTED})}
|
|
75
|
-
Regexp
|
|
76
|
-
)
|
|
57
|
+
SCALA_VERSION_VAL_REGEX =
|
|
58
|
+
%r{(?:ThisBuild\s*/\s*)?(?:scalaVersion\s+in\s+ThisBuild|scalaVersion)\s*:=\s*(?<val_name>#{IDENT_OR_DOTTED})}
|
|
77
59
|
|
|
78
60
|
sig { override.returns(T::Array[Dependabot::Dependency]) }
|
|
79
61
|
def parse
|
|
@@ -15,12 +15,9 @@ module Dependabot
|
|
|
15
15
|
require_relative "file_updater/property_value_updater"
|
|
16
16
|
|
|
17
17
|
# Regex matching scalaVersion declarations in all supported SBT syntaxes
|
|
18
|
-
SCALA_VERSION_DECL =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'\\s*:=\\s*"',
|
|
22
|
-
String
|
|
23
|
-
)
|
|
18
|
+
SCALA_VERSION_DECL = "(?:ThisBuild\\s*/\\s*)?" \
|
|
19
|
+
"(?:scalaVersion\\s+in\\s+ThisBuild|scalaVersion)" \
|
|
20
|
+
'\\s*:=\\s*"'
|
|
24
21
|
|
|
25
22
|
sig { override.returns(T::Array[Dependabot::DependencyFile]) }
|
|
26
23
|
def updated_dependency_files
|
|
@@ -60,8 +57,8 @@ module Dependabot
|
|
|
60
57
|
.reject { |new_req, old_req| new_req == old_req }
|
|
61
58
|
|
|
62
59
|
reqs.each do |new_req, old_req|
|
|
63
|
-
raise "Bad req match" unless new_req
|
|
64
|
-
next if new_req
|
|
60
|
+
raise "Bad req match" unless new_req.file == T.must(old_req).file
|
|
61
|
+
next if new_req.requirement == T.must(old_req).requirement
|
|
65
62
|
|
|
66
63
|
files = apply_requirement_update(files, dependency, new_req, T.must(old_req))
|
|
67
64
|
end
|
|
@@ -73,21 +70,21 @@ module Dependabot
|
|
|
73
70
|
params(
|
|
74
71
|
files: T::Array[Dependabot::DependencyFile],
|
|
75
72
|
dependency: Dependabot::Dependency,
|
|
76
|
-
new_req:
|
|
77
|
-
old_req:
|
|
73
|
+
new_req: Dependabot::DependencyRequirement,
|
|
74
|
+
old_req: Dependabot::DependencyRequirement
|
|
78
75
|
).returns(T::Array[Dependabot::DependencyFile])
|
|
79
76
|
end
|
|
80
77
|
def apply_requirement_update(files, dependency, new_req, old_req)
|
|
81
|
-
if new_req.
|
|
78
|
+
if new_req.metadata_string("property_name")
|
|
82
79
|
update_files_for_property_change(files, old_req, new_req)
|
|
83
|
-
elsif T.
|
|
80
|
+
elsif T.must(new_req.file).end_with?("build.properties")
|
|
84
81
|
update_build_properties(files, old_req, new_req)
|
|
85
82
|
elsif scala_version_requirement?(new_req)
|
|
86
|
-
file = T.must(files.find { |f| f.name == new_req
|
|
83
|
+
file = T.must(files.find { |f| f.name == new_req.file })
|
|
87
84
|
idx = T.must(files.index(file))
|
|
88
85
|
files.dup.tap { |updated| updated[idx] = update_scala_version(file, old_req, new_req) }
|
|
89
86
|
else
|
|
90
|
-
file = T.must(files.find { |f| f.name == new_req
|
|
87
|
+
file = T.must(files.find { |f| f.name == new_req.file })
|
|
91
88
|
idx = T.must(files.index(file))
|
|
92
89
|
files.dup.tap { |updated| updated[idx] = update_version_in_buildfile(dependency, file, old_req, new_req) }
|
|
93
90
|
end
|
|
@@ -96,34 +93,34 @@ module Dependabot
|
|
|
96
93
|
sig do
|
|
97
94
|
params(
|
|
98
95
|
files: T::Array[Dependabot::DependencyFile],
|
|
99
|
-
old_req:
|
|
100
|
-
new_req:
|
|
96
|
+
old_req: Dependabot::DependencyRequirement,
|
|
97
|
+
new_req: Dependabot::DependencyRequirement
|
|
101
98
|
).returns(T::Array[Dependabot::DependencyFile])
|
|
102
99
|
end
|
|
103
100
|
def update_files_for_property_change(files, old_req, new_req)
|
|
104
|
-
property_name = T.
|
|
105
|
-
callsite = T.must(files.find { |f| f.name == new_req
|
|
101
|
+
property_name = T.must(new_req.metadata_string("property_name"))
|
|
102
|
+
callsite = T.must(files.find { |f| f.name == new_req.file })
|
|
106
103
|
|
|
107
104
|
PropertyValueUpdater.new(dependency_files: files)
|
|
108
105
|
.update_files_for_property_change(
|
|
109
106
|
property_name: property_name,
|
|
110
107
|
callsite_buildfile: callsite,
|
|
111
|
-
previous_value: T.
|
|
112
|
-
updated_value: T.
|
|
108
|
+
previous_value: T.must(old_req.requirement_string),
|
|
109
|
+
updated_value: T.must(new_req.requirement_string)
|
|
113
110
|
)
|
|
114
111
|
end
|
|
115
112
|
|
|
116
113
|
sig do
|
|
117
114
|
params(
|
|
118
115
|
files: T::Array[Dependabot::DependencyFile],
|
|
119
|
-
old_req:
|
|
120
|
-
new_req:
|
|
116
|
+
old_req: Dependabot::DependencyRequirement,
|
|
117
|
+
new_req: Dependabot::DependencyRequirement
|
|
121
118
|
).returns(T::Array[Dependabot::DependencyFile])
|
|
122
119
|
end
|
|
123
120
|
def update_build_properties(files, old_req, new_req)
|
|
124
|
-
file = T.must(files.find { |f| f.name == new_req
|
|
125
|
-
old_version = T.
|
|
126
|
-
new_version = T.
|
|
121
|
+
file = T.must(files.find { |f| f.name == new_req.file })
|
|
122
|
+
old_version = T.must(old_req.requirement_string)
|
|
123
|
+
new_version = T.must(new_req.requirement_string)
|
|
127
124
|
|
|
128
125
|
updated_content = T.must(file.content).sub(
|
|
129
126
|
/(sbt\.version\s*=\s*)#{Regexp.quote(old_version)}/,
|
|
@@ -141,13 +138,13 @@ module Dependabot
|
|
|
141
138
|
sig do
|
|
142
139
|
params(
|
|
143
140
|
file: Dependabot::DependencyFile,
|
|
144
|
-
old_req:
|
|
145
|
-
new_req:
|
|
141
|
+
old_req: Dependabot::DependencyRequirement,
|
|
142
|
+
new_req: Dependabot::DependencyRequirement
|
|
146
143
|
).returns(Dependabot::DependencyFile)
|
|
147
144
|
end
|
|
148
145
|
def update_scala_version(file, old_req, new_req)
|
|
149
|
-
old_version = T.
|
|
150
|
-
new_version = T.
|
|
146
|
+
old_version = T.must(old_req.requirement_string)
|
|
147
|
+
new_version = T.must(new_req.requirement_string)
|
|
151
148
|
|
|
152
149
|
updated_content = T.must(file.content).sub(
|
|
153
150
|
/(#{SCALA_VERSION_DECL})#{Regexp.quote(old_version)}(")/,
|
|
@@ -163,8 +160,8 @@ module Dependabot
|
|
|
163
160
|
params(
|
|
164
161
|
dependency: Dependabot::Dependency,
|
|
165
162
|
buildfile: Dependabot::DependencyFile,
|
|
166
|
-
previous_req:
|
|
167
|
-
requirement:
|
|
163
|
+
previous_req: Dependabot::DependencyRequirement,
|
|
164
|
+
requirement: Dependabot::DependencyRequirement
|
|
168
165
|
).returns(Dependabot::DependencyFile)
|
|
169
166
|
end
|
|
170
167
|
def update_version_in_buildfile(dependency, buildfile, previous_req, requirement)
|
|
@@ -185,18 +182,18 @@ module Dependabot
|
|
|
185
182
|
sig do
|
|
186
183
|
params(
|
|
187
184
|
dependency: Dependabot::Dependency,
|
|
188
|
-
requirement:
|
|
185
|
+
requirement: Dependabot::DependencyRequirement
|
|
189
186
|
).returns(T::Array[String])
|
|
190
187
|
end
|
|
191
188
|
def original_buildfile_declarations(dependency, requirement)
|
|
192
|
-
buildfile = T.must(dependency_files.find { |f| f.name ==
|
|
189
|
+
buildfile = T.must(dependency_files.find { |f| f.name == requirement.file })
|
|
193
190
|
group, artifact = dependency_group_and_artifact(dependency)
|
|
194
191
|
|
|
195
192
|
T.must(buildfile.content).lines.select do |line|
|
|
196
193
|
next false unless line.include?(group)
|
|
197
194
|
next false unless line.include?(artifact)
|
|
198
195
|
|
|
199
|
-
line.include?(T.
|
|
196
|
+
line.include?(T.must(requirement.requirement_string))
|
|
200
197
|
end
|
|
201
198
|
end
|
|
202
199
|
|
|
@@ -215,13 +212,13 @@ module Dependabot
|
|
|
215
212
|
sig do
|
|
216
213
|
params(
|
|
217
214
|
old_declaration: String,
|
|
218
|
-
previous_req:
|
|
219
|
-
requirement:
|
|
215
|
+
previous_req: Dependabot::DependencyRequirement,
|
|
216
|
+
requirement: Dependabot::DependencyRequirement
|
|
220
217
|
).returns(String)
|
|
221
218
|
end
|
|
222
219
|
def updated_buildfile_declaration(old_declaration, previous_req, requirement)
|
|
223
|
-
original_req_string = T.
|
|
224
|
-
new_req_string = T.
|
|
220
|
+
original_req_string = T.must(previous_req.requirement_string)
|
|
221
|
+
new_req_string = T.must(requirement.requirement_string)
|
|
225
222
|
|
|
226
223
|
old_declaration.gsub(
|
|
227
224
|
/"#{Regexp.quote(original_req_string)}"/,
|
|
@@ -229,9 +226,9 @@ module Dependabot
|
|
|
229
226
|
)
|
|
230
227
|
end
|
|
231
228
|
|
|
232
|
-
sig { params(req:
|
|
229
|
+
sig { params(req: Dependabot::DependencyRequirement).returns(T::Boolean) }
|
|
233
230
|
def scala_version_requirement?(req)
|
|
234
|
-
req.
|
|
231
|
+
req.metadata_string("property_source") == "scalaVersion"
|
|
235
232
|
end
|
|
236
233
|
end
|
|
237
234
|
end
|
|
@@ -26,9 +26,9 @@ module Dependabot
|
|
|
26
26
|
).void
|
|
27
27
|
end
|
|
28
28
|
def initialize(dependency:, dependency_files:, credentials:)
|
|
29
|
-
@dependency =
|
|
30
|
-
@dependency_files =
|
|
31
|
-
@credentials =
|
|
29
|
+
@dependency = dependency
|
|
30
|
+
@dependency_files = dependency_files
|
|
31
|
+
@credentials = credentials
|
|
32
32
|
|
|
33
33
|
@repositories_cache = T.let(nil, T.nilable(T::Array[T::Hash[String, T.untyped]]))
|
|
34
34
|
@repository_finder = T.let(nil, T.nilable(Sbt::FileParser::RepositoriesFinder))
|
|
@@ -140,7 +140,7 @@ module Dependabot
|
|
|
140
140
|
# SBT plugins are identified by having "plugins" in their groups.
|
|
141
141
|
sig { returns(T::Boolean) }
|
|
142
142
|
def sbt_plugin?
|
|
143
|
-
dependency.requirements.any? { |req| req.
|
|
143
|
+
dependency.requirements.any? { |req| req.groups&.include?("plugins") }
|
|
144
144
|
end
|
|
145
145
|
|
|
146
146
|
# SBT 1.x plugins use Scala 2.12; SBT 2.x plugins use Scala 3.
|
|
@@ -18,8 +18,8 @@ module Dependabot
|
|
|
18
18
|
|
|
19
19
|
quoted = OPS.keys.map { |k| Regexp.quote k }.join("|")
|
|
20
20
|
PATTERN_RAW = T.let("\\s*(#{quoted})?\\s*(#{Sbt::Version::VERSION_PATTERN})\\s*".freeze, String)
|
|
21
|
-
PATTERN =
|
|
22
|
-
RUBY_STYLE_PATTERN =
|
|
21
|
+
PATTERN = /\A#{PATTERN_RAW}\z/
|
|
22
|
+
RUBY_STYLE_PATTERN = /\A\s*(#{quoted})\s*(#{Sbt::Version::VERSION_PATTERN})\s*\z/
|
|
23
23
|
|
|
24
24
|
sig { override.returns(Regexp) }
|
|
25
25
|
def self.pattern
|
|
@@ -47,13 +47,14 @@ module Dependabot
|
|
|
47
47
|
return requirements unless latest_version
|
|
48
48
|
|
|
49
49
|
requirements.map do |req|
|
|
50
|
-
|
|
51
|
-
next req if
|
|
50
|
+
requirement = req.requirement_string
|
|
51
|
+
next req if requirement.nil?
|
|
52
|
+
next req if requirement.include?(",")
|
|
52
53
|
|
|
53
|
-
property_name = req.
|
|
54
|
+
property_name = req.metadata_string("property_name")
|
|
54
55
|
next req if property_name && !properties_to_update.include?(property_name)
|
|
55
56
|
|
|
56
|
-
new_req = update_requirement(
|
|
57
|
+
new_req = update_requirement(requirement)
|
|
57
58
|
Dependabot::DependencyRequirement.create(req.merge(requirement: new_req, source: updated_source))
|
|
58
59
|
end
|
|
59
60
|
end
|
|
@@ -51,7 +51,7 @@ module Dependabot
|
|
|
51
51
|
def updated_requirements
|
|
52
52
|
property_names =
|
|
53
53
|
declarations_using_a_property
|
|
54
|
-
.filter_map { |req| req.
|
|
54
|
+
.filter_map { |req| req.metadata_string("property_name") }
|
|
55
55
|
|
|
56
56
|
RequirementsUpdater.new(
|
|
57
57
|
requirements: dependency.requirements,
|
|
@@ -132,8 +132,8 @@ module Dependabot
|
|
|
132
132
|
sig { returns(T::Boolean) }
|
|
133
133
|
def version_comes_from_multi_dependency_property?
|
|
134
134
|
declarations_using_a_property.any? do |requirement|
|
|
135
|
-
property_name = requirement.
|
|
136
|
-
property_source = requirement.
|
|
135
|
+
property_name = requirement.metadata_string("property_name")
|
|
136
|
+
property_source = requirement.metadata_string("property_source")
|
|
137
137
|
|
|
138
138
|
next false unless property_name
|
|
139
139
|
|
|
@@ -141,20 +141,20 @@ module Dependabot
|
|
|
141
141
|
next false if dep.name == dependency.name
|
|
142
142
|
|
|
143
143
|
dep.requirements.any? do |req|
|
|
144
|
-
next unless req.
|
|
144
|
+
next unless req.metadata_string("property_name") == property_name
|
|
145
145
|
|
|
146
|
-
req.
|
|
146
|
+
req.metadata_string("property_source") == property_source
|
|
147
147
|
end
|
|
148
148
|
end
|
|
149
149
|
end
|
|
150
150
|
end
|
|
151
151
|
|
|
152
|
-
sig { returns(T::Array[
|
|
152
|
+
sig { returns(T::Array[Dependabot::DependencyRequirement]) }
|
|
153
153
|
def declarations_using_a_property
|
|
154
154
|
@declarations_using_a_property ||= T.let(
|
|
155
155
|
dependency.requirements
|
|
156
|
-
.select { |req| req.
|
|
157
|
-
T.nilable(T::Array[
|
|
156
|
+
.select { |req| req.metadata_string("property_name") },
|
|
157
|
+
T.nilable(T::Array[Dependabot::DependencyRequirement])
|
|
158
158
|
)
|
|
159
159
|
end
|
|
160
160
|
|
|
@@ -165,7 +165,7 @@ module Dependabot
|
|
|
165
165
|
dependency_files: dependency_files,
|
|
166
166
|
source: nil
|
|
167
167
|
).parse.select do |dep|
|
|
168
|
-
dep.requirements.any? { |req| req.
|
|
168
|
+
dep.requirements.any? { |req| req.metadata_string("property_name") }
|
|
169
169
|
end,
|
|
170
170
|
T.nilable(T::Array[Dependabot::Dependency])
|
|
171
171
|
)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dependabot-sbt
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.391.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dependabot
|
|
@@ -15,28 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.391.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.
|
|
25
|
+
version: 0.391.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: dependabot-maven
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - '='
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 0.
|
|
32
|
+
version: 0.391.0
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - '='
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 0.
|
|
39
|
+
version: 0.391.0
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: debug
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -277,7 +277,7 @@ licenses:
|
|
|
277
277
|
- MIT
|
|
278
278
|
metadata:
|
|
279
279
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
|
280
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
|
280
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.391.0
|
|
281
281
|
rdoc_options: []
|
|
282
282
|
require_paths:
|
|
283
283
|
- lib
|