Skip to content

Commit 2820877

Browse files
committed
Fix lint failures, update rubocop
Ran rubocop -A to resolve all lint errors. Signed-off-by: Hayden <8418760+Hayden-IO@users.noreply.github.com>
1 parent 2d7dfa2 commit 2820877

File tree

9 files changed

+44
-30
lines changed

9 files changed

+44
-30
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ gemspec path: "cli"
88

99
gem "cgi", "~> 0.5.0" # Used by webmock
1010
gem "rake", "~> 13.3"
11-
gem "rubocop", "~> 1.67"
11+
gem "rubocop", "~> 1.85"
1212
gem "rubocop-performance", "~> 1.23"
1313
gem "rubocop-rake", "~> 0.6.0"
1414
gem "simplecov", "~> 0.22.0"

Gemfile.lock

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,22 @@ GEM
3232
hashdiff (1.1.2)
3333
json (2.10.2)
3434
json (2.10.2-java)
35+
json-schema (6.2.0)
36+
addressable (~> 2.8)
37+
bigdecimal (>= 3.1, < 5)
3538
language_server-protocol (3.17.0.4)
39+
lint_roller (1.1.0)
3640
logger (1.7.0)
41+
mcp (0.8.0)
42+
json-schema (>= 4.1)
3743
net-http (0.6.0)
3844
uri
3945
parallel (1.26.3)
40-
parser (3.3.7.1)
46+
parser (3.3.10.2)
4147
ast (~> 2.4.1)
4248
racc
4349
power_assert (2.0.5)
50+
prism (1.9.0)
4451
protobug (0.1.0)
4552
protobug_googleapis_field_behavior_protos (0.1.0)
4653
protobug (= 0.1.0)
@@ -58,18 +65,21 @@ GEM
5865
rake (13.3.0)
5966
regexp_parser (2.10.0)
6067
rexml (3.4.2)
61-
rubocop (1.67.0)
68+
rubocop (1.85.1)
6269
json (~> 2.3)
63-
language_server-protocol (>= 3.17.0)
70+
language_server-protocol (~> 3.17.0.2)
71+
lint_roller (~> 1.1.0)
72+
mcp (~> 0.6)
6473
parallel (~> 1.10)
6574
parser (>= 3.3.0.2)
6675
rainbow (>= 2.2.2, < 4.0)
67-
regexp_parser (>= 2.4, < 3.0)
68-
rubocop-ast (>= 1.32.2, < 2.0)
76+
regexp_parser (>= 2.9.3, < 3.0)
77+
rubocop-ast (>= 1.49.0, < 2.0)
6978
ruby-progressbar (~> 1.7)
70-
unicode-display_width (>= 2.4.0, < 3.0)
71-
rubocop-ast (1.38.0)
72-
parser (>= 3.3.1.0)
79+
unicode-display_width (>= 2.4.0, < 4.0)
80+
rubocop-ast (1.49.0)
81+
parser (>= 3.3.7.2)
82+
prism (~> 1.7)
7383
rubocop-performance (1.23.1)
7484
rubocop (>= 1.48.1, < 2.0)
7585
rubocop-ast (>= 1.31.1, < 2.0)
@@ -108,7 +118,7 @@ PLATFORMS
108118
DEPENDENCIES
109119
cgi (~> 0.5.0)
110120
rake (~> 13.3)
111-
rubocop (~> 1.67)
121+
rubocop (~> 1.85)
112122
rubocop-performance (~> 1.23)
113123
rubocop-rake (~> 0.6.0)
114124
sigstore!
@@ -133,12 +143,16 @@ CHECKSUMS
133143
hashdiff (1.1.2) sha256=2c30eeded6ed3dce8401d2b5b99e6963fe5f14ed85e60dd9e33c545a44b71a77
134144
json (2.10.2) sha256=34e0eada93022b2a0a3345bb0b5efddb6e9ff5be7c48e409cfb54ff8a36a8b06
135145
json (2.10.2-java) sha256=fe31faac61ea21ea1448c35450183f84e85c2b94cc6522c241959ba9d1362006
146+
json-schema (6.2.0) sha256=e8bff46ed845a22c1ab2bd0d7eccf831c01fe23bb3920caa4c74db4306813666
136147
language_server-protocol (3.17.0.4) sha256=c484626478664fd13482d8180947c50a8590484b1258b99b7aedb3b69df89669
148+
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
137149
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
150+
mcp (0.8.0) sha256=ae8bd146bb8e168852866fd26f805f52744f6326afb3211e073f78a95e0c34fb
138151
net-http (0.6.0) sha256=9621b20c137898af9d890556848c93603716cab516dc2c89b01a38b894e259fb
139152
parallel (1.26.3) sha256=d86babb7a2b814be9f4b81587bf0b6ce2da7d45969fab24d8ae4bf2bb4d4c7ef
140-
parser (3.3.7.1) sha256=7dbe61618025519024ac72402a6677ead02099587a5538e84371b76659e6aca1
153+
parser (3.3.10.2) sha256=6f60c84aa4bdcedb6d1a2434b738fe8a8136807b6adc8f7f53b97da9bc4e9357
141154
power_assert (2.0.5) sha256=63b511b85bb8ea57336d25156864498644f5bbf028699ceda27949e0125bc323
155+
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
142156
protobug (0.1.0) sha256=5bf1356cedf99dcf311890743b78f5e602f62ca703e574764337f1996b746bf2
143157
protobug_googleapis_field_behavior_protos (0.1.0) sha256=db48ef6a5913b2355b4a6931ab400a9e3e995fb48499977a3ad0be6365f9e265
144158
protobug_sigstore_protos (0.1.0) sha256=4ad1eebaf6454131b6f432dda50ad0e513773613474b92470847614a5acacce1
@@ -150,8 +164,8 @@ CHECKSUMS
150164
rake (13.3.0) sha256=96f5092d786ff412c62fde76f793cc0541bd84d2eb579caa529aa8a059934493
151165
regexp_parser (2.10.0) sha256=cb6f0ddde88772cd64bff1dbbf68df66d376043fe2e66a9ef77fcb1b0c548c61
152166
rexml (3.4.2) sha256=1384268554a37af5da5279431ca3f2f37d46f09ffdd6c95e17cc84c83ea7c417
153-
rubocop (1.67.0) sha256=8ccca7226e76d0a9974af960ea446d1fb38adf0c491214294e2fed75a85c378c
154-
rubocop-ast (1.38.0) sha256=4fdf6792fe443a9a18acb12dbc8225d0d64cd1654e41fedb30e79c18edbb26ae
167+
rubocop (1.85.1) sha256=3dbcf9e961baa4c376eeeb2a03913dca5e3987033b04d38fa538aa1e7406cc77
168+
rubocop-ast (1.49.0) sha256=49c3676d3123a0923d333e20c6c2dbaaae2d2287b475273fddee0c61da9f71fd
155169
rubocop-performance (1.23.1) sha256=f22f86a795f5e6a6180aac2c6fc172534b173a068d6ed3396d6460523e051b82
156170
rubocop-rake (0.6.0) sha256=56b6f22189af4b33d4f4e490a555c09f1281b02f4d48c3a61f6e8fe5f401d8db
157171
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ task :find_action_versions do # rubocop:disable Rake/Desc
6161
require "yaml"
6262
gh = YAML.load_file(".github/workflows/ci.yml")
6363
actions = gh.fetch("jobs").flat_map { |_, job| job.fetch("steps", []).filter_map { |step| step.fetch("uses", nil) } }
64-
.uniq.map { |x| x.split("@", 2) }
65-
.group_by(&:first).transform_values { |v| v.map(&:last) }
64+
.uniq.map { |x| x.split("@", 2) }
65+
.group_by(&:first).transform_values { |v| v.map(&:last) }
6666
if actions.any? { |_, v| v.size > 1 }
6767
raise StandardError, "conflicts: #{actions.select { |_, v| v.size > 1 }.inspect}"
6868
end

lib/sigstore/internal/merkle.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def self.root_from_inclusion_proof(log_index, tree_size, proof, leaf_hash)
6969

7070
intermediate_result = chain_inner(
7171
leaf_hash,
72-
(proof[...inner] || raise(MissingHashError, "missing left hashes")),
72+
proof[...inner] || raise(MissingHashError, "missing left hashes"),
7373
log_index
7474
)
7575

@@ -93,7 +93,7 @@ def self.hash_leaf(data)
9393

9494
def self.chain_inner(seed, hashes, log_index)
9595
hashes.each_with_index do |hash, i|
96-
seed = if ((log_index >> i) & 1).zero?
96+
seed = if (log_index >> i).nobits?(1)
9797
hash_children(seed, hash)
9898
else
9999
hash_children(hash, seed)

lib/sigstore/internal/x509.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def parse_value(value)
438438
signature_algorithm
439439
entry_type
440440
signature]
441-
Timestamp = defined?(Data.define) ? Data.define(*args) : Struct.new(*args, keyword_init: true) # rubocop:disable Naming/ConstantName
441+
Timestamp = defined?(Data.define) ? Data.define(*args) : Struct.new(*args) # rubocop:disable Naming/ConstantName
442442

443443
HASHES = {
444444
0 => "none",

lib/sigstore/models.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
require_relative "trusted_root"
2020

2121
module Sigstore
22-
VerificationResult = Struct.new(:success, keyword_init: true) do
22+
VerificationResult = Struct.new(:success) do
2323
# @implements VerificationResult
2424

2525
alias_method :verified?, :success

lib/sigstore/rekor/checkpoint.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
module Sigstore
1818
module Rekor
1919
module Checkpoint
20-
Signature = Struct.new(:name, :sig_hash, :signature, keyword_init: true)
20+
Signature = Struct.new(:name, :sig_hash, :signature)
2121

22-
SignedCheckpoint = Struct.new(:signed_note, :checkpoint, keyword_init: true) do
22+
SignedCheckpoint = Struct.new(:signed_note, :checkpoint) do
2323
# @implements SignedCheckpoint
2424

2525
def self.from_text(text)
@@ -30,7 +30,7 @@ def self.from_text(text)
3030
end
3131
end
3232

33-
SignedNote = Struct.new(:note, :signatures, keyword_init: true) do
33+
SignedNote = Struct.new(:note, :signatures) do
3434
# @implements SignedNote
3535

3636
def self.from_text(text)
@@ -77,7 +77,7 @@ def verify(rekor_keyring, key_id)
7777
end
7878
end
7979

80-
LogCheckpoint = Struct.new(:origin, :log_size, :log_hash, :other_content, keyword_init: true) do
80+
LogCheckpoint = Struct.new(:origin, :log_size, :log_hash, :other_content) do
8181
# @implements LogCheckpoint
8282

8383
def self.from_text(text)

lib/sigstore/verifier.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ def verify_in_toto(input, in_toto_payload)
236236

237237
return if matched
238238

239-
VerificationFailure.new(
240-
"None of in-toto subjects matches artifact for #{expected_algorithm}: #{expected_hexdigest}"
241-
)
239+
VerificationFailure.new(
240+
"None of in-toto subjects matches artifact for #{expected_algorithm}: #{expected_hexdigest}"
241+
)
242242
end
243243

244244
public

test/sigstore/trusted_root_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ def test_production
99
Timecop.freeze(cassette.originally_recorded_at || Time.now) do
1010
production = Sigstore::TrustedRoot.production
1111
assert_equal "application/vnd.dev.sigstore.trustedroot+json;version=0.1", production.media_type
12-
assert_equal ["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2G2Y+2tabdTV5BcGiBIx0a9f\n" \
12+
assert_equal(["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2G2Y+2tabdTV5BcGiBIx0a9f\n" \
1313
"AFwrkBbmLSGtks4L3qX6yYY0zufBnhC8Ur/iy55GhWP/9A/bY2LhC30M9+RY\n" \
14-
"tw==\n"], production.rekor_keys.map { [_1.to_der].pack("m") }
15-
assert_equal ["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEbfwR+RJudXscgRBRpKX1XFDy\n" \
14+
"tw==\n"], production.rekor_keys.map { [_1.to_der].pack("m") })
15+
assert_equal(["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEbfwR+RJudXscgRBRpKX1XFDy\n" \
1616
"3PyudDxz/SfnRi1fT8ekpfBd2O1uoz7jr3Z8nKzxA69EUQ+eFCFI3zeubPWU\n" \
1717
"7w==\n",
1818
"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiPSlFi0CmFTfEjCUqF9HuCEc\n" \
1919
"YXNKAaYalIJmBZ8yyezPjTqhxrKBpMnaocVtLJBI1eM3uXnQzQGAJdJ4gs9F\n" \
20-
"yw==\n"], production.ctfe_keys.map { [_1.to_der].pack("m") }
20+
"yw==\n"], production.ctfe_keys.map { [_1.to_der].pack("m") })
2121
assert_equal "chain 0\n" \
2222
"-----BEGIN CERTIFICATE-----\n" \
2323
"MIIB+DCCAX6gAwIBAgITNVkDZoCiofPDsy7dfm6geLbuhzAKBggqhkjOPQQDAzAq\n" \

0 commit comments

Comments
 (0)