extend/os/linux/hardware/cpu: typed: strict#21171
Merged
Conversation
Also update `features` to avoid discarding the first flag. This was likely done before 8738ad3 as the capture group used to include the "flags" or "Features" text
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables Sorbet's strict type checking for the Linux CPU hardware detection module by upgrading from typed: true to typed: strict. The changes include adding type signatures to all methods and fixing a bug in the features method that was previously discarding the first CPU flag.
Key changes:
- Upgraded type strictness from
typed: truetotyped: strict - Added type signatures to all methods in the module
- Fixed bug in
featuresmethod: changed fromflags[1..](which discarded the first flag) toflags.map(&:intern)(which correctly converts all flags to symbols) - Added
T.lettype annotations for instance variable memoization
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
p-linnane
approved these changes
Dec 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
brew lgtm(style, typechecking and tests) with your changes locally?Also update
featuresto avoid discarding the first flag. This was likely done before 8738ad3 as the capture group used to include the "flags" or "Features" textPart of
typed: strictin all (non-package) files in Homebrew organisation #17297