dependabot-gradle 0.261.1 → 0.263.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependabot/gradle/file_fetcher/settings_file_parser.rb +28 -19
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24cb48fee1554bb80686222457a3ac875711f7aa66d301fe5df8cbac7dd391b2
|
4
|
+
data.tar.gz: 6ca760eaefb642e424de330300dc9df7822d5c582c114807e5c14b0497acb60e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f461e1de8da682cdf99c4750e8f04022486d70a54eca1526ee3ef70e2a95939e7099fca0ffba60e533148345dd1a0277c6ea54566fc05bfaff73d75f238a4f5
|
7
|
+
data.tar.gz: a92c58501204b577f31be4570170a4fc078495abb9c779b792c9d36529fecbf2e8067b9c49956a6de9071e1235bf69d85723568ee06a7169487083d9a821772e
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# typed:
|
1
|
+
# typed: strong
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require "sorbet-runtime"
|
@@ -11,53 +11,61 @@ module Dependabot
|
|
11
11
|
class SettingsFileParser
|
12
12
|
extend T::Sig
|
13
13
|
|
14
|
+
sig { params(settings_file: Dependabot::DependencyFile).void }
|
14
15
|
def initialize(settings_file:)
|
15
16
|
@settings_file = settings_file
|
16
17
|
end
|
17
18
|
|
19
|
+
sig { returns(T::Array[String]) }
|
18
20
|
def included_build_paths
|
19
21
|
paths = []
|
20
|
-
comment_free_content
|
22
|
+
comment_free_content&.scan(function_regex("includeBuild")) do
|
21
23
|
arg = T.must(Regexp.last_match).named_captures.fetch("args")
|
22
24
|
paths << T.must(arg).gsub(/["']/, "").strip
|
23
25
|
end
|
24
26
|
paths.uniq
|
25
27
|
end
|
26
28
|
|
29
|
+
sig { returns(T::Array[T.nilable(String)]) }
|
27
30
|
def subproject_paths
|
28
31
|
subprojects = T.let([], T::Array[String])
|
32
|
+
process_include_functions(subprojects)
|
33
|
+
subprojects.uniq.map { |name| process_subproject_name(name) }
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
29
37
|
|
30
|
-
|
38
|
+
sig { params(subprojects: T::Array[String]).void }
|
39
|
+
def process_include_functions(subprojects)
|
40
|
+
comment_free_content&.scan(function_regex("include")) do
|
31
41
|
args = T.must(Regexp.last_match).named_captures.fetch("args")
|
32
42
|
args = T.must(args).split(",")
|
33
43
|
args = args.filter_map { |p| p.gsub(/["']/, "").strip }
|
34
|
-
subprojects
|
44
|
+
subprojects.concat(args)
|
35
45
|
end
|
46
|
+
end
|
36
47
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
proj.tr(":", "/").sub(%r{^/}, "")
|
45
|
-
end
|
48
|
+
sig { params(proj: String).returns(T.nilable(String)) }
|
49
|
+
def process_subproject_name(proj)
|
50
|
+
if comment_free_content&.match?(project_dir_regex(proj))
|
51
|
+
comment_free_content&.match(project_dir_regex(proj))
|
52
|
+
&.named_captures&.fetch("path")&.sub(%r{^/}, "")
|
53
|
+
else
|
54
|
+
proj.tr(":", "/").sub(%r{^/}, "")
|
46
55
|
end
|
47
|
-
|
48
|
-
subproject_dirs.uniq
|
49
56
|
end
|
50
57
|
|
51
|
-
|
52
|
-
|
58
|
+
sig { returns(Dependabot::DependencyFile) }
|
53
59
|
attr_reader :settings_file
|
54
60
|
|
61
|
+
sig { returns(T.nilable(String)) }
|
55
62
|
def comment_free_content
|
56
63
|
settings_file.content
|
57
|
-
|
58
|
-
|
64
|
+
&.gsub(%r{(?<=^|\s)//.*$}, "\n")
|
65
|
+
&.gsub(%r{(?<=^|\s)/\*.*?\*/}m, "")
|
59
66
|
end
|
60
67
|
|
68
|
+
sig { params(function_name: T.any(String, Symbol)).returns(Regexp) }
|
61
69
|
def function_regex(function_name)
|
62
70
|
/
|
63
71
|
(?:^|\s)#{Regexp.quote(function_name)}(?:\s*\(|\s)
|
@@ -65,6 +73,7 @@ module Dependabot
|
|
65
73
|
/mx
|
66
74
|
end
|
67
75
|
|
76
|
+
sig { params(proj: String).returns(Regexp) }
|
68
77
|
def project_dir_regex(proj)
|
69
78
|
prefixed_proj = Regexp.quote(":#{proj.gsub(/^:/, '')}")
|
70
79
|
/['"]#{prefixed_proj}['"].*dir\s*=.*['"](?<path>.*?)['"]/i
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-gradle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.263.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dependabot-common
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.263.0
|
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: 0.
|
26
|
+
version: 0.263.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: dependabot-maven
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.263.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.263.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: debug
|
43
43
|
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.263.0
|
281
281
|
post_install_message:
|
282
282
|
rdoc_options: []
|
283
283
|
require_paths:
|