Skip to content

Commit

Permalink
Exclude conformance tests from rubocop (#38)
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Giddins <[email protected]>
  • Loading branch information
segiddins authored Aug 2, 2024
1 parent e4bc73b commit dc151a8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
AllCops:
TargetRubyVersion: 3.0
NewCops: enable
Exclude:
- 'test/sigstore-conformance/**/*'
- 'test/tuf-conformance/**/*'

require:
- rubocop-performance
- rubocop-rake

Style/StringLiterals:
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ gemspec
gem "base64", "~> 0.2.0" # Until https://github.com/vcr/vcr/commit/5c9230b43b6a51dec78941d16bf8e2954042964c is released
gem "rake", "~> 13.2"
gem "rubocop", "~> 1.64"
gem "rubocop-performance", "~> 1.21"
gem "rubocop-rake", "~> 0.6.0"
gem "simplecov", "~> 0.22.0"
gem "test-unit", "~> 3.0"
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
ruby-progressbar (1.13.0)
Expand Down Expand Up @@ -91,6 +94,7 @@ DEPENDENCIES
base64 (~> 0.2.0)
rake (~> 13.2)
rubocop (~> 1.64)
rubocop-performance (~> 1.21)
rubocop-rake (~> 0.6.0)
sigstore!
simplecov (~> 0.22.0)
Expand Down Expand Up @@ -127,6 +131,7 @@ CHECKSUMS
rexml (3.3.2) sha256=4513686f858d0ff2e5a412d734c8a192e16cb1df4cb2063f56b72a8ad4c5257f
rubocop (1.64.1) sha256=3145bf1863771e400a1c041060e751e5ff0edd9ceb99d01df36db1902f611f3b
rubocop-ast (1.31.3) sha256=1b07d618d8776993ec6053a706d1c09f0bf15139fd69415924656cbff07e7818
rubocop-performance (1.21.1) sha256=5cf20002a544275ad6aa99abca4b945d2a2ed71be925c38fe83700360ed8734e
rubocop-rake (0.6.0) sha256=56b6f22189af4b33d4f4e490a555c09f1281b02f4d48c3a61f6e8fe5f401d8db
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
sigstore (0.1.0)
Expand Down
4 changes: 2 additions & 2 deletions lib/sigstore/internal/x509.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def parse_value(value)
end

@purposes = value.value
return if @purposes.all? { |v| v.is_a?(OpenSSL::ASN1::ObjectId) }
return if @purposes.all?(OpenSSL::ASN1::ObjectId)

raise ArgumentError,
"Invalid extended key usage: #{value.inspect}"
Expand All @@ -239,7 +239,7 @@ def parse_value(value)
CODE_SIGNING = OpenSSL::ASN1::ObjectId.new("1.3.6.1.5.5.7.3.3")

def code_signing?
purposes.any? { |oid| oid == CODE_SIGNING }
purposes.any?(CODE_SIGNING)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/sigstore/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def find_rekor_entry(rekor_client)
[k, json_hash_diff[a[k], b[k]]]
end.compact
when Array
a.zip(b).map { |x, y| json_hash_diff[x, y] }.compact
a.zip(b).filter_map { |x, y| json_hash_diff[x, y] }
when String
begin
require "base64"
Expand Down

0 comments on commit dc151a8

Please sign in to comment.