dependabot-hex 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27d33792dfe1e80e7983633d35c802b8e740e597b27511bbf5b62d7d53d2524e
4
- data.tar.gz: f8a13617553b91170a7dca0a50ebdb3a9d68326961c3919851119e1b6b08b972
3
+ metadata.gz: c2616cdd2af9c1e91a12d85abb82fcdc47ccc27ec270d837c60c3a9d035b5fa7
4
+ data.tar.gz: 8a5e0ba936625eac56641e7b8354fbff58f28db8ec5bf94b373b0371b9d19bc3
5
5
  SHA512:
6
- metadata.gz: d21ffaea5f67baf3b4c937d578cc1f2f7dc5945d7cdc90e6f7bd28a38309f58b2821aff0df65d41aa3be7d970995bc8792045f23a83da1c4c79f16b730b14e3c
7
- data.tar.gz: ab89c2440795290fd4088ed5b6d7d705d8d4b2d33f96e396ea3e5c56492c9ab7f943783282cb91b28759ce10e3c00982a27ef0b57c9bb5bb9bbd583cffcdd726
6
+ metadata.gz: 5c199f8f993def433c74a545056f73610cb0e3510e855e6c666fa82da8f11c80ceaab116f863d36f049e263273de246ccb8c293aa1c802924ed1fd9db5ecacda
7
+ data.tar.gz: ee4777cd89c4eafdf2d0b0ee32925a29d5e359b92dc6273060ba36f821eab066b566e094a244527a8c9b9b639f867a95b2d533ab1c0efc342ceed060473322c8
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "sorbet-runtime"
@@ -13,14 +13,16 @@ module Dependabot
13
13
 
14
14
  APPS_PATH_REGEX = /apps_path:\s*"(?<path>.*?)"/m
15
15
  STRING_ARG = %{(?:["'](.*?)["'])}
16
- SUPPORTED_METHODS = %w(eval_file require_file).join("|").freeze
16
+ SUPPORTED_METHODS = T.let(%w(eval_file require_file).join("|").freeze, String)
17
17
  SUPPORT_FILE = /Code\.(?:#{SUPPORTED_METHODS})\(#{STRING_ARG}(?:\s*,\s*#{STRING_ARG})?\)/
18
18
  PATH_DEPS_REGEX = /{.*path: ?#{STRING_ARG}.*}/
19
19
 
20
+ sig { override.params(filenames: T::Array[String]).returns(T::Boolean) }
20
21
  def self.required_files_in?(filenames)
21
22
  filenames.include?("mix.exs")
22
23
  end
23
24
 
25
+ sig { override.returns(String) }
24
26
  def self.required_files_message
25
27
  "Repo must contain a mix.exs."
26
28
  end
@@ -37,25 +39,28 @@ module Dependabot
37
39
 
38
40
  private
39
41
 
42
+ sig { returns(T.nilable(DependencyFile)) }
40
43
  def mixfile
41
- @mixfile ||= fetch_file_from_host("mix.exs")
44
+ @mixfile ||= T.let(fetch_file_from_host("mix.exs"), T.nilable(Dependabot::DependencyFile))
45
+ fetch_file_from_host("mix.exs")
42
46
  end
43
47
 
48
+ sig { returns(T.nilable(Dependabot::DependencyFile)) }
44
49
  def lockfile
45
- return @lockfile if defined?(@lockfile)
46
-
47
- @lockfile = fetch_lockfile
50
+ @lockfile ||= T.let(fetch_lockfile, T.nilable(DependencyFile))
48
51
  end
49
52
 
53
+ sig { returns(T.nilable(Dependabot::DependencyFile)) }
50
54
  def fetch_lockfile
51
55
  fetch_file_from_host("mix.lock")
52
56
  rescue Dependabot::DependencyFileNotFound
53
57
  nil
54
58
  end
55
59
 
60
+ sig { returns(T::Array[String]) }
56
61
  def umbrella_app_directories
57
- apps_path = mixfile.content.match(APPS_PATH_REGEX)
58
- &.named_captures&.fetch("path")
62
+ apps_path = T.must(T.must(mixfile).content).match(APPS_PATH_REGEX)
63
+ &.named_captures&.fetch("path")
59
64
  return [] unless apps_path
60
65
 
61
66
  repo_contents(dir: apps_path)
@@ -63,10 +68,12 @@ module Dependabot
63
68
  .map { |f| File.join(apps_path, f.name) }
64
69
  end
65
70
 
71
+ sig { returns(T::Array[String]) }
66
72
  def sub_project_directories
67
- mixfile.content.scan(PATH_DEPS_REGEX).flatten
73
+ T.must(T.must(mixfile).content).scan(PATH_DEPS_REGEX).flatten
68
74
  end
69
75
 
76
+ sig { returns(T::Array[Dependabot::DependencyFile]) }
70
77
  def subapp_mixfiles
71
78
  subapp_directories = []
72
79
  subapp_directories += umbrella_app_directories
@@ -86,15 +93,17 @@ module Dependabot
86
93
  []
87
94
  end
88
95
 
96
+ sig { returns(T::Array[T.nilable(Dependabot::DependencyFile)]) }
89
97
  def support_files
90
98
  mixfiles = [mixfile] + subapp_mixfiles
91
99
 
92
100
  mixfiles.flat_map do |mixfile|
93
- mixfile_dir = mixfile.path.to_s.delete_prefix("/").delete_suffix("/mix.exs")
101
+ mixfile_dir = mixfile&.path&.to_s&.delete_prefix("/")&.delete_suffix("/mix.exs")
94
102
 
95
- mixfile.content.gsub("__DIR__", "\"#{mixfile_dir}\"").scan(SUPPORT_FILE).map do |support_file_args|
96
- path = Pathname.new(File.join(*support_file_args.compact.reverse))
97
- .cleanpath.to_path
103
+ mixfile&.content&.gsub("__DIR__", "\"#{mixfile_dir}\"")&.scan(SUPPORT_FILE)&.map do |support_file_args|
104
+ path = Pathname.new(File.join(Array(support_file_args).compact.reverse))
105
+ .cleanpath
106
+ .to_path
98
107
  fetch_file_from_host(path).tap { |f| f.support_file = true }
99
108
  end
100
109
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-hex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.261.1
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-17 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,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.261.1
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.261.1
26
+ version: 0.263.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  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.261.1
275
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.263.0
276
276
  post_install_message:
277
277
  rdoc_options: []
278
278
  require_paths: