dependabot-gradle 0.262.0 → 0.263.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a030ae92a1ad242061604cdf1539a1e71ecd8da55cf8efebaed77cf933c7f3e4
4
- data.tar.gz: ea81ec27791890cff4e7c3552186ee9c2cc8c9004aff6fc3f6db1d0fe1026d0b
3
+ metadata.gz: 24cb48fee1554bb80686222457a3ac875711f7aa66d301fe5df8cbac7dd391b2
4
+ data.tar.gz: 6ca760eaefb642e424de330300dc9df7822d5c582c114807e5c14b0497acb60e
5
5
  SHA512:
6
- metadata.gz: e47e3532b98a2d438d819d49dcf26a755adeff307b6f4f69e7e564c7a04bfc2b4a50d616991bd677d0fa38083c24e36c394cdfd9aa6df7232bd0a568d0cd4953
7
- data.tar.gz: 2450516acf431f0873cc90c5eadf602972a7a65c71805fb348ccf54f1c6d35c51b52f211d9c09caa2b0fa0bdfddab86e9e3374ca1c8d6a9563f340530a1f5988
6
+ metadata.gz: 9f461e1de8da682cdf99c4750e8f04022486d70a54eca1526ee3ef70e2a95939e7099fca0ffba60e533148345dd1a0277c6ea54566fc05bfaff73d75f238a4f5
7
+ data.tar.gz: a92c58501204b577f31be4570170a4fc078495abb9c779b792c9d36529fecbf2e8067b9c49956a6de9071e1235bf69d85723568ee06a7169487083d9a821772e
@@ -1,4 +1,4 @@
1
- # typed: true
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.scan(function_regex("includeBuild")) do
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
- comment_free_content.scan(function_regex("include")) do
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 += args
44
+ subprojects.concat(args)
35
45
  end
46
+ end
36
47
 
37
- subprojects = subprojects.uniq
38
-
39
- subproject_dirs = subprojects.map do |proj|
40
- if comment_free_content.match?(project_dir_regex(proj))
41
- comment_free_content.match(project_dir_regex(proj))
42
- .named_captures.fetch("path").sub(%r{^/}, "")
43
- else
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
- private
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
- .gsub(%r{(?<=^|\s)//.*$}, "\n")
58
- .gsub(%r{(?<=^|\s)/\*.*?\*/}m, "")
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.262.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-20 00:00:00.000000000 Z
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.262.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.262.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.262.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.262.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.262.0
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: