Skip to content

Commit

Permalink
Upgrade standardrb.
Browse files Browse the repository at this point in the history
  • Loading branch information
myronmarston committed Feb 21, 2025
1 parent b7a5175 commit 67e5002
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ group :development do
gem "rspec-retry", "~> 0.6"
gem "simplecov", "~> 0.22"
gem "simplecov-console", "~> 0.9"
gem "standard", "~> 1.44.0"
gem "standard", "~> 1.45.0"
gem "steep", "~> 1.9.4"
gem "super_diff", "~> 0.15"
gem "vcr", "~> 6.3", ">= 6.3.1"
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ GEM
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.13.2)
rubocop (1.70.0)
rubocop (1.71.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down Expand Up @@ -466,10 +466,10 @@ GEM
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
simpleidn (0.2.3)
standard (1.44.0)
standard (1.45.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.70.0)
rubocop (~> 1.71.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.6)
standard-custom (1.0.2)
Expand Down Expand Up @@ -575,7 +575,7 @@ DEPENDENCIES
rubocop-rspec (~> 3.4)
simplecov (~> 0.22)
simplecov-console (~> 0.9)
standard (~> 1.44.0)
standard (~> 1.45.0)
steep (~> 1.9.4)
super_diff (~> 0.15)
vcr (~> 6.3, >= 6.3.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def self.prune(original_json_schema)
types_to_keep = referenced_type_names(initial_type_names, original_json_schema["$defs"])

# The .select will preserve the sort order of the original hash
# standard:disable Style/HashSlice -- https://github.com/soutaro/steep/issues/1503
pruned_defs = original_json_schema["$defs"].select { |k, _v| types_to_keep.include?(k) }
# standard:enable Style/HashSlice

original_json_schema.merge("$defs" => pruned_defs)
end
Expand All @@ -31,7 +33,7 @@ def self.prune(original_json_schema)
def self.referenced_type_names(source_type_names, original_defs)
return Set.new if source_type_names.empty?

referenced_type_defs = original_defs.select { |k, _| source_type_names.include?(k) }
referenced_type_defs = original_defs.slice(*source_type_names)
ref_names = collect_ref_names(referenced_type_defs)

referenced_type_names(ref_names, original_defs) + source_type_names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ def check_for_circular_dependencies!
end

circular_reference_sets = referenced_types_by_source_type
# standard:disable Style/HashSlice -- https://github.com/rubocop/rubocop/issues/13885
.select { |source_type, referenced_types| referenced_types.include?(source_type) }
# standard:enable Style/HashSlice
.values
.uniq

Expand Down

0 comments on commit 67e5002

Please sign in to comment.