dependabot-terraform 0.230.0 → 0.232.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: 00b632bdb0f8f86aab981b9bb8b22e9d378d3900a1e253d16f48bc658db56ac9
4
- data.tar.gz: 39d7654dedae5668693175eafbe1e069d7dd398cac0d83406e2b198a804adb06
3
+ metadata.gz: 3a03d570c8ffb7ca7cc2e0d1de7cf92a6d74052a346cc12d72ff6ad19a7dfa41
4
+ data.tar.gz: 307eb85dfac86ff6fee7f79256d49c3c97766574566b78ffaf8117d2deb0d30f
5
5
  SHA512:
6
- metadata.gz: 04bd911c6b9b55afcf229c0a55bb5216ff4f12c7af06ce0c78f446f32d474bdede6aa18289738be040bec1da8ff1d3ea918cb324dffa6eaf150f0ca19a2cc7c1
7
- data.tar.gz: cefaa4765d1f8b91d3c6019ac356911d7878d24cac51cd4ef5652b82c2db297c0661de2384efadabf3a82a7b755e13c8ad457a308352ed56706a156449e647dc
6
+ metadata.gz: caf48067db039a6cded9678654ef232d79085b38de3096fe83153ef3060719c8558c0455726dfa6aec99729c856ade8fcc99b2a6baedb9f0a290491d537f401b
7
+ data.tar.gz: 630299f581147a0bec80e9c2fba37826abf171eaf2d31681dda658e879c7bbe2054a598d33b1fddec3e03eed1ed0a3019ae2edf029f9b56c1a9d20b43c2a49ac
@@ -1,3 +1,4 @@
1
+ # typed: false
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require "dependabot/file_fetchers"
@@ -39,16 +40,16 @@ module Dependabot
39
40
 
40
41
  def terraform_files
41
42
  @terraform_files ||=
42
- repo_contents(raise_errors: false).
43
- select { |f| f.type == "file" && f.name.end_with?(".tf") }.
44
- map { |f| fetch_file_from_host(f.name) }
43
+ repo_contents(raise_errors: false)
44
+ .select { |f| f.type == "file" && f.name.end_with?(".tf") }
45
+ .map { |f| fetch_file_from_host(f.name) }
45
46
  end
46
47
 
47
48
  def terragrunt_files
48
49
  @terragrunt_files ||=
49
- repo_contents(raise_errors: false).
50
- select { |f| f.type == "file" && terragrunt_file?(f.name) }.
51
- map { |f| fetch_file_from_host(f.name) }
50
+ repo_contents(raise_errors: false)
51
+ .select { |f| f.type == "file" && terragrunt_file?(f.name) }
52
+ .map { |f| fetch_file_from_host(f.name) }
52
53
  end
53
54
 
54
55
  def local_path_module_files(files, dir: ".")
@@ -58,9 +59,9 @@ module Dependabot
58
59
  terraform_file_local_module_details(file).each do |path|
59
60
  base_path = Pathname.new(File.join(dir, path)).cleanpath.to_path
60
61
  nested_terraform_files =
61
- repo_contents(dir: base_path).
62
- select { |f| f.type == "file" && f.name.end_with?(".tf") }.
63
- map { |f| fetch_file_from_host(File.join(base_path, f.name)) }
62
+ repo_contents(dir: base_path)
63
+ .select { |f| f.type == "file" && f.name.end_with?(".tf") }
64
+ .map { |f| fetch_file_from_host(File.join(base_path, f.name)) }
64
65
  terraform_files += nested_terraform_files
65
66
  terraform_files += local_path_module_files(nested_terraform_files, dir: path)
66
67
  end
@@ -89,5 +90,5 @@ module Dependabot
89
90
  end
90
91
  end
91
92
 
92
- Dependabot::FileFetchers.
93
- register("terraform", Dependabot::Terraform::FileFetcher)
93
+ Dependabot::FileFetchers
94
+ .register("terraform", Dependabot::Terraform::FileFetcher)
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require "cgi"
@@ -355,8 +356,8 @@ module Dependabot
355
356
  def determine_version_for(hostname, namespace, name, constraint)
356
357
  return constraint if constraint&.match?(/\A\d/)
357
358
 
358
- lock_file_content.
359
- dig("provider", "#{hostname}/#{namespace}/#{name}", 0, "version")
359
+ lock_file_content
360
+ .dig("provider", "#{hostname}/#{namespace}/#{name}", 0, "version")
360
361
  end
361
362
 
362
363
  def lock_file_content
@@ -372,5 +373,5 @@ module Dependabot
372
373
  end
373
374
  end
374
375
 
375
- Dependabot::FileParsers.
376
- register("terraform", Dependabot::Terraform::FileParser)
376
+ Dependabot::FileParsers
377
+ .register("terraform", Dependabot::Terraform::FileParser)
@@ -1,3 +1,4 @@
1
+ # typed: false
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module FileSelector
@@ -1,3 +1,4 @@
1
+ # typed: false
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require "dependabot/file_updaters"
@@ -75,8 +76,8 @@ module Dependabot
75
76
  def updated_terraform_file_content(file)
76
77
  content = file.content.dup
77
78
 
78
- reqs = dependency.requirements.zip(dependency.previous_requirements).
79
- reject { |new_req, old_req| new_req == old_req }
79
+ reqs = dependency.requirements.zip(dependency.previous_requirements)
80
+ .reject { |new_req, old_req| new_req == old_req }
80
81
 
81
82
  # Loop through each changed requirement and update the files and lockfile
82
83
  reqs.each do |new_req, old_req|
@@ -125,15 +126,15 @@ module Dependabot
125
126
  end
126
127
 
127
128
  def extract_provider_h1_hashes(content, declaration_regex)
128
- content.match(declaration_regex).to_s.
129
- match(hashes_object_regex).to_s.
130
- split("\n").map { |hash| hash.match(hashes_string_regex).to_s }.
131
- select { |h| h&.match?(/^h1:/) }
129
+ content.match(declaration_regex).to_s
130
+ .match(hashes_object_regex).to_s
131
+ .split("\n").map { |hash| hash.match(hashes_string_regex).to_s }
132
+ .select { |h| h&.match?(/^h1:/) }
132
133
  end
133
134
 
134
135
  def remove_provider_h1_hashes(content, declaration_regex)
135
- content.match(declaration_regex).to_s.
136
- sub(hashes_object_regex, "")
136
+ content.match(declaration_regex).to_s
137
+ .sub(hashes_object_regex, "")
137
138
  end
138
139
 
139
140
  def lockfile_details(new_req)
@@ -373,5 +374,5 @@ module Dependabot
373
374
  end
374
375
  end
375
376
 
376
- Dependabot::FileUpdaters.
377
- register("terraform", Dependabot::Terraform::FileUpdater)
377
+ Dependabot::FileUpdaters
378
+ .register("terraform", Dependabot::Terraform::FileUpdater)
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require "excon"
@@ -35,13 +36,13 @@ module Dependabot
35
36
  info = dependency.requirements.filter_map { |r| r[:source] }.first
36
37
  hostname = info[:registry_hostname] || info["registry_hostname"]
37
38
 
38
- RegistryClient.
39
- new(hostname: hostname, credentials: credentials).
40
- source(dependency: dependency)
39
+ RegistryClient
40
+ .new(hostname: hostname, credentials: credentials)
41
+ .source(dependency: dependency)
41
42
  end
42
43
  end
43
44
  end
44
45
  end
45
46
 
46
- Dependabot::MetadataFinders.
47
- register("terraform", Dependabot::Terraform::MetadataFinder)
47
+ Dependabot::MetadataFinders
48
+ .register("terraform", Dependabot::Terraform::MetadataFinder)
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require "dependabot/dependency"
@@ -61,9 +62,9 @@ module Dependabot
61
62
  base_url = service_url_for("providers.v1")
62
63
  response = http_get!(URI.join(base_url, "#{identifier}/versions"))
63
64
 
64
- JSON.parse(response.body).
65
- fetch("versions").
66
- map { |release| version_class.new(release.fetch("version")) }
65
+ JSON.parse(response.body)
66
+ .fetch("versions")
67
+ .map { |release| version_class.new(release.fetch("version")) }
67
68
  rescue Excon::Error
68
69
  raise error("Could not fetch provider versions")
69
70
  end
@@ -79,9 +80,9 @@ module Dependabot
79
80
  base_url = service_url_for("modules.v1")
80
81
  response = http_get!(URI.join(base_url, "#{identifier}/versions"))
81
82
 
82
- JSON.parse(response.body).
83
- fetch("modules").first.fetch("versions").
84
- map { |release| version_class.new(release.fetch("version")) }
83
+ JSON.parse(response.body)
84
+ .fetch("modules").first.fetch("versions")
85
+ .map { |release| version_class.new(release.fetch("version")) }
85
86
  end
86
87
 
87
88
  # Fetch the "source" for a module or provider. We use the API to fetch
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require "dependabot/utils"
@@ -47,5 +48,5 @@ module Dependabot
47
48
  end
48
49
  end
49
50
 
50
- Dependabot::Utils.
51
- register_requirement_class("terraform", Dependabot::Terraform::Requirement)
51
+ Dependabot::Utils
52
+ .register_requirement_class("terraform", Dependabot::Terraform::Requirement)
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  # frozen_string_literal: true
2
3
 
3
4
  ####################################################################
@@ -109,8 +110,8 @@ module Dependabot
109
110
 
110
111
  # Updates the version in a "~>" constraint to allow the given version
111
112
  def update_twiddle_version(req_string)
112
- old_version = requirement_class.new(req_string).
113
- requirements.first.last
113
+ old_version = requirement_class.new(req_string)
114
+ .requirements.first.last
114
115
  updated_version = at_same_precision(latest_version, old_version)
115
116
  req_string.sub(old_version.to_s, updated_version)
116
117
  end
@@ -137,9 +138,9 @@ module Dependabot
137
138
  new_release =
138
139
  new_version.to_s.split(".").first(release_precision)
139
140
  new_prerelease =
140
- new_version.to_s.split(".").
141
- drop_while { |i| i.match?(/^\d+$/) }.
142
- first([prerelease_precision, 1].max)
141
+ new_version.to_s.split(".")
142
+ .drop_while { |i| i.match?(/^\d+$/) }
143
+ .first([prerelease_precision, 1].max)
143
144
 
144
145
  [*new_release, *new_prerelease].join(".")
145
146
  end
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require "dependabot/update_checkers"
@@ -122,13 +123,13 @@ module Dependabot
122
123
  # we want to update that tag. Because we don't have a lockfile, the
123
124
  # latest version is the tag itself.
124
125
  if git_commit_checker.pinned_ref_looks_like_version?
125
- latest_tag = git_commit_checker.local_tag_for_latest_version&.
126
- fetch(:tag)
126
+ latest_tag = git_commit_checker.local_tag_for_latest_version
127
+ &.fetch(:tag)
127
128
  version_rgx = GitCommitChecker::VERSION_REGEX
128
129
  return unless latest_tag.match(version_rgx)
129
130
 
130
- version = latest_tag.match(version_rgx).
131
- named_captures.fetch("version")
131
+ version = latest_tag.match(version_rgx)
132
+ .named_captures.fetch("version")
132
133
  return version_class.new(version)
133
134
  end
134
135
 
@@ -142,8 +143,8 @@ module Dependabot
142
143
  return unless git_commit_checker.pinned?
143
144
  return unless git_commit_checker.pinned_ref_looks_like_version?
144
145
 
145
- latest_tag = git_commit_checker.local_tag_for_latest_version&.
146
- fetch(:tag)
146
+ latest_tag = git_commit_checker.local_tag_for_latest_version
147
+ &.fetch(:tag)
147
148
 
148
149
  version_rgx = GitCommitChecker::VERSION_REGEX
149
150
  return unless latest_tag.match(version_rgx)
@@ -190,5 +191,5 @@ module Dependabot
190
191
  end
191
192
  end
192
193
 
193
- Dependabot::UpdateCheckers.
194
- register("terraform", Dependabot::Terraform::UpdateChecker)
194
+ Dependabot::UpdateCheckers
195
+ .register("terraform", Dependabot::Terraform::UpdateChecker)
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require "dependabot/version"
@@ -23,5 +24,5 @@ module Dependabot
23
24
  end
24
25
  end
25
26
 
26
- Dependabot::Utils.
27
- register_version_class("terraform", Dependabot::Terraform::Version)
27
+ Dependabot::Utils
28
+ .register_version_class("terraform", Dependabot::Terraform::Version)
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  # frozen_string_literal: true
2
3
 
3
4
  # These all need to be required so the various classes can be registered in a
@@ -11,18 +12,18 @@ require "dependabot/terraform/requirement"
11
12
  require "dependabot/terraform/version"
12
13
 
13
14
  require "dependabot/pull_request_creator/labeler"
14
- Dependabot::PullRequestCreator::Labeler.
15
- register_label_details("terraform", name: "terraform", colour: "5C4EE5")
15
+ Dependabot::PullRequestCreator::Labeler
16
+ .register_label_details("terraform", name: "terraform", colour: "5C4EE5")
16
17
 
17
18
  require "dependabot/dependency"
18
- Dependabot::Dependency.
19
- register_production_check("terraform", ->(_) { true })
19
+ Dependabot::Dependency
20
+ .register_production_check("terraform", ->(_) { true })
20
21
 
21
22
  require "dependabot/utils"
22
23
  Dependabot::Utils.register_always_clone("terraform")
23
24
 
24
- Dependabot::Dependency.
25
- register_display_name_builder(
25
+ Dependabot::Dependency
26
+ .register_display_name_builder(
26
27
  "terraform",
27
28
  lambda { |name|
28
29
  # Only modify the name if it a git source dependency
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-terraform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.230.0
4
+ version: 0.232.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-08 00:00:00.000000000 Z
11
+ date: 2023-09-14 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.230.0
19
+ version: 0.232.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.230.0
26
+ version: 0.232.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 1.19.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop-sorbet
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 0.7.3
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 0.7.3
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: stackprof
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -203,7 +217,7 @@ licenses:
203
217
  - Nonstandard
204
218
  metadata:
205
219
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
206
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.230.0
220
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.232.0
207
221
  post_install_message:
208
222
  rdoc_options: []
209
223
  require_paths: