Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove OpenStruct from primer_octicon cop #3055

Merged
merged 2 commits into from
Sep 4, 2024
Merged

Conversation

camertron
Copy link
Contributor

Shamelessly copy/pasting what @HParker wrote in #3052

OpenStruct will not be included in modern Ruby versions, so we should not rely on it being there. This removes usage and instead builds the same class instance that is returned above.

irb(main):003> h = RuboCop::AST::HashNode.new(hash) => s(:hash)
irb(main):004> h.keys
=> []
irb(main):005> h.pairs
=> []
irb(main):006> h.type
=> :hash

Copy link

changeset-bot bot commented Sep 4, 2024

🦋 Changeset detected

Latest commit: 1617834

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@camertron camertron marked this pull request as ready for review September 4, 2024 21:59
@camertron camertron requested a review from a team as a code owner September 4, 2024 21:59
@camertron camertron enabled auto-merge (squash) September 4, 2024 21:59
@camertron camertron merged commit ca4eae5 into main Sep 4, 2024
37 checks passed
@camertron camertron deleted the fix_openstruct_usage branch September 4, 2024 21:59
@primer primer bot mentioned this pull request Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant