dependabot-hex 0.124.7 → 0.125.3

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: 687d422f29e9c27f8c770c21374f63a0dea03b8fb52ab078ab44c5c5eb9ed418
4
- data.tar.gz: 63abd57dd5c0c63a4f82c2e48ee30a5a86eef8e1cf6ab52bfdab3ec7c0f9030e
3
+ metadata.gz: a36c9777c2db45cf67dd2ce2d81aaec014dd27d62edad43069deb80bad80d3fd
4
+ data.tar.gz: d4f53fb6fe1be904d461995842890a5ff8b07a0dd6f06d1460c7724d855fdc8e
5
5
  SHA512:
6
- metadata.gz: 38ca94e9279385f0a8a8b8cc3672d2269fbeb46f63c3f28e5adc7c08f2a7eb6f60eee632b3707ecc8c5b6896106d48f955027f703820de85c802cd04ee60ca34
7
- data.tar.gz: d4d41e8f8f03b2eb0ca95877b90226cb1161092ab4d715a3e2f8f3cb7ca1131cca867f7166a91f2f156c15e0ca44a0348bb8114889bdfc9132cf1d894cb9dc50
6
+ metadata.gz: 7ca5e56a99fc842eabdb7707caea000a3e7b8bfcbfd022efabb08ddfee1d05ca2ab5a7ccb17bf921157cc9dc426a5e223c239bb9b48980e6e6e8dc6cfd7f6c30
7
+ data.tar.gz: ca81978e969bde8dcd3fa8136a471cb16b9a96ec6fa6ba50533515806fe9671464070163fe00dc2f0c206e4a20f229ef282b32bd7f907638278e7b281ee93bab
@@ -8,8 +8,9 @@ module Dependabot
8
8
  class FileFetcher < Dependabot::FileFetchers::Base
9
9
  APPS_PATH_REGEX = /apps_path:\s*"(?<path>.*?)"/m.freeze
10
10
  STRING_ARG = %{(?:["'](.*?)["'])}
11
- EVAL_FILE = /Code\.eval_file\(#{STRING_ARG}(?:\s*,\s*#{STRING_ARG})?\)/.
12
- freeze
11
+ SUPPORTED_METHODS = %w(eval_file require_file).join("|").freeze
12
+ SUPPORT_FILE = /Code\.(?:#{SUPPORTED_METHODS})\(#{STRING_ARG}(?:\s*,\s*#{STRING_ARG})?\)/.
13
+ freeze
13
14
 
14
15
  def self.required_files_in?(filenames)
15
16
  filenames.include?("mix.exs")
@@ -26,7 +27,7 @@ module Dependabot
26
27
  fetched_files << mixfile
27
28
  fetched_files << lockfile if lockfile
28
29
  fetched_files += subapp_mixfiles
29
- fetched_files += evaled_files
30
+ fetched_files += support_files
30
31
  fetched_files
31
32
  end
32
33
 
@@ -66,9 +67,9 @@ module Dependabot
66
67
  []
67
68
  end
68
69
 
69
- def evaled_files
70
- mixfile.content.scan(EVAL_FILE).map do |eval_file_args|
71
- path = Pathname.new(File.join(*eval_file_args.reverse)).
70
+ def support_files
71
+ mixfile.content.scan(SUPPORT_FILE).map do |support_file_args|
72
+ path = Pathname.new(File.join(*support_file_args.compact.reverse)).
72
73
  cleanpath.to_path
73
74
  fetch_file_from_host(path).tap { |f| f.support_file = true }
74
75
  end
@@ -42,7 +42,7 @@ module Dependabot
42
42
  def dependency_details
43
43
  SharedHelpers.in_a_temporary_directory do
44
44
  write_sanitized_mixfiles
45
- write_supporting_files
45
+ write_sanitized_supporting_files
46
46
  File.write("mix.lock", lockfile.content) if lockfile
47
47
  FileUtils.cp(elixir_helper_parse_deps_path, "parse_deps.exs")
48
48
 
@@ -73,11 +73,11 @@ module Dependabot
73
73
  end
74
74
  end
75
75
 
76
- def write_supporting_files
76
+ def write_sanitized_supporting_files
77
77
  dependency_files.select(&:support_file).each do |file|
78
78
  path = file.name
79
79
  FileUtils.mkdir_p(Pathname.new(path).dirname)
80
- File.write(path, file.content)
80
+ File.write(path, sanitize_mixfile(file.content))
81
81
  end
82
82
  end
83
83
 
@@ -66,7 +66,7 @@ module Dependabot
66
66
  dependency_files.select(&:support_file).each do |file|
67
67
  path = file.name
68
68
  FileUtils.mkdir_p(Pathname.new(path).dirname)
69
- File.write(path, file.content)
69
+ File.write(path, sanitize_mixfile(file.content))
70
70
  end
71
71
  end
72
72
 
@@ -18,9 +18,7 @@ module Dependabot
18
18
  def updated_content
19
19
  updated_content = update_pin(mixfile_content)
20
20
 
21
- if content_should_change? && mixfile_content == updated_content
22
- raise "Expected content to change!"
23
- end
21
+ raise "Expected content to change!" if content_should_change? && mixfile_content == updated_content
24
22
 
25
23
  updated_content
26
24
  end
@@ -20,9 +20,7 @@ module Dependabot
20
20
  def updated_content
21
21
  updated_content = update_requirement(mixfile_content)
22
22
 
23
- if content_should_change? && mixfile_content == updated_content
24
- raise "Expected content to change!"
25
- end
23
+ raise "Expected content to change!" if content_should_change? && mixfile_content == updated_content
26
24
 
27
25
  updated_content
28
26
  end
@@ -68,9 +68,7 @@ module Dependabot
68
68
  def latest_resolvable_version_for_git_dependency
69
69
  # If the gem isn't pinned, the latest version is just the latest
70
70
  # commit for the specified branch.
71
- unless git_commit_checker.pinned?
72
- return latest_resolvable_commit_with_unchanged_git_source
73
- end
71
+ return latest_resolvable_commit_with_unchanged_git_source unless git_commit_checker.pinned?
74
72
 
75
73
  # If the dependency is pinned to a tag that looks like a version then
76
74
  # we want to update that tag. The latest version will then be the SHA
@@ -103,9 +101,7 @@ module Dependabot
103
101
  def latest_git_version_sha
104
102
  # If the gem isn't pinned, the latest version is just the latest
105
103
  # commit for the specified branch.
106
- unless git_commit_checker.pinned?
107
- return git_commit_checker.head_commit_for_current_branch
108
- end
104
+ return git_commit_checker.head_commit_for_current_branch unless git_commit_checker.pinned?
109
105
 
110
106
  # If the dependency is pinned to a tag that looks like a version then
111
107
  # we want to update that tag. The latest version will then be the SHA
@@ -225,9 +221,7 @@ module Dependabot
225
221
  ignore_reqs.any? { |r| r.satisfied_by?(v) }
226
222
  end
227
223
 
228
- if @raise_on_ignored && filtered.empty? && versions.any?
229
- raise AllVersionsIgnored
230
- end
224
+ raise AllVersionsIgnored if @raise_on_ignored && filtered.empty? && versions.any?
231
225
 
232
226
  filtered.max
233
227
  end
@@ -54,14 +54,10 @@ module Dependabot
54
54
  def mixfile_content_for_update_check(file)
55
55
  content = file.content
56
56
 
57
- unless dependency_appears_in_file?(file.name)
58
- return sanitize_mixfile(content)
59
- end
57
+ return sanitize_mixfile(content) unless dependency_appears_in_file?(file.name)
60
58
 
61
59
  content = relax_version(content, filename: file.name)
62
- if replace_git_pin?
63
- content = replace_git_pin(content, filename: file.name)
64
- end
60
+ content = replace_git_pin(content, filename: file.name) if replace_git_pin?
65
61
 
66
62
  sanitize_mixfile(content)
67
63
  end
@@ -85,9 +81,7 @@ module Dependabot
85
81
  lower_bound_req = updated_version_req_lower_bound(filename)
86
82
 
87
83
  return lower_bound_req if latest_allowable_version.nil?
88
- unless version_class.correct?(latest_allowable_version)
89
- return lower_bound_req
90
- end
84
+ return lower_bound_req unless version_class.correct?(latest_allowable_version)
91
85
 
92
86
  lower_bound_req + " and <= #{latest_allowable_version}"
93
87
  end
@@ -54,9 +54,7 @@ module Dependabot
54
54
  update_mixfile_range(last_string_reqs).map(&:to_s).join(" and ")
55
55
  end
56
56
 
57
- if or_string_reqs.count > 1
58
- new_requirement = req[:requirement] + " or " + new_requirement
59
- end
57
+ new_requirement = req[:requirement] + " or " + new_requirement if or_string_reqs.count > 1
60
58
 
61
59
  req.merge(requirement: new_requirement)
62
60
  end
@@ -66,9 +64,7 @@ module Dependabot
66
64
  def update_source(requirement_hash)
67
65
  # Only git sources ever need to be updated. Anything else should be
68
66
  # left alone.
69
- unless requirement_hash.dig(:source, :type) == "git"
70
- return requirement_hash
71
- end
67
+ return requirement_hash unless requirement_hash.dig(:source, :type) == "git"
72
68
 
73
69
  requirement_hash.merge(source: updated_source)
74
70
  end
@@ -31,7 +31,7 @@ module Dependabot
31
31
  def fetch_latest_resolvable_version
32
32
  latest_resolvable_version =
33
33
  SharedHelpers.in_a_temporary_directory do
34
- write_temporary_dependency_files
34
+ write_temporary_sanitized_dependency_files
35
35
  FileUtils.cp(
36
36
  elixir_helper_check_update_path,
37
37
  "check_update.exs"
@@ -43,9 +43,7 @@ module Dependabot
43
43
  end
44
44
 
45
45
  return if latest_resolvable_version.nil?
46
- if latest_resolvable_version.match?(/^[0-9a-f]{40}$/)
47
- return latest_resolvable_version
48
- end
46
+ return latest_resolvable_version if latest_resolvable_version.match?(/^[0-9a-f]{40}$/)
49
47
 
50
48
  version_class.new(latest_resolvable_version)
51
49
  rescue SharedHelpers::HelperSubprocessFailed => e
@@ -111,7 +109,7 @@ module Dependabot
111
109
 
112
110
  def check_original_requirements_resolvable
113
111
  SharedHelpers.in_a_temporary_directory do
114
- write_temporary_dependency_files(prepared: false)
112
+ write_temporary_sanitized_dependency_files(prepared: false)
115
113
  FileUtils.cp(
116
114
  elixir_helper_check_update_path,
117
115
  "check_update.exs"
@@ -127,7 +125,7 @@ module Dependabot
127
125
  raise Dependabot::DependencyFileNotResolvable, e.message
128
126
  end
129
127
 
130
- def write_temporary_dependency_files(prepared: true)
128
+ def write_temporary_sanitized_dependency_files(prepared: true)
131
129
  files = if prepared then prepared_dependency_files
132
130
  else original_dependency_files
133
131
  end
@@ -135,12 +133,7 @@ module Dependabot
135
133
  files.each do |file|
136
134
  path = file.name
137
135
  FileUtils.mkdir_p(Pathname.new(path).dirname)
138
-
139
- if file.name.end_with?("mix.exs")
140
- File.write(path, sanitize_mixfile(file.content))
141
- else
142
- File.write(path, file.content)
143
- end
136
+ File.write(path, sanitize_mixfile(file.content))
144
137
  end
145
138
  end
146
139
 
@@ -24,9 +24,7 @@ module Dependabot
24
24
  def initialize(version)
25
25
  @version_string = version.to_s
26
26
 
27
- if version.to_s.include?("+")
28
- version, @build_info = version.to_s.split("+")
29
- end
27
+ version, @build_info = version.to_s.split("+") if version.to_s.include?("+")
30
28
 
31
29
  super
32
30
  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.124.7
4
+ version: 0.125.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-03 00:00:00.000000000 Z
11
+ date: 2020-11-16 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.124.7
19
+ version: 0.125.3
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.124.7
26
+ version: 0.125.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.7.2
131
+ version: 0.8.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.7.2
138
+ version: 0.8.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: vcr
141
141
  requirement: !ruby/object:Gem::Requirement