Skip to content

extend/os/linux/hardware/cpu: typed: strict#21171

Merged
cho-m merged 1 commit intomainfrom
linux-hardware-cpu-typed
Dec 4, 2025
Merged

extend/os/linux/hardware/cpu: typed: strict#21171
cho-m merged 1 commit intomainfrom
linux-hardware-cpu-typed

Conversation

@cho-m
Copy link
Copy Markdown
Member

@cho-m cho-m commented Dec 3, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

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


Part of

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
Copilot AI review requested due to automatic review settings December 3, 2025 20:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: true to typed: strict
  • Added type signatures to all methods in the module
  • Fixed bug in features method: changed from flags[1..] (which discarded the first flag) to flags.map(&:intern) (which correctly converts all flags to symbols)
  • Added T.let type annotations for instance variable memoization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cho-m cho-m added this pull request to the merge queue Dec 4, 2025
Merged via the queue into main with commit d00eb45 Dec 4, 2025
43 checks passed
@cho-m cho-m deleted the linux-hardware-cpu-typed branch December 4, 2025 00:53
Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants