Skip to content

Introduce type_fingerprint - #2644

Merged
soutaro merged 1 commit into
masterfrom
type-finterprint
Aug 26, 2025
Merged

Introduce type_fingerprint#2644
soutaro merged 1 commit into
masterfrom
type-finterprint

Conversation

@soutaro

@soutaro soutaro commented Aug 25, 2025

Copy link
Copy Markdown
Member

This PR introduces #type_fingerprint method that compute a fingerprint of inline RBS type declarations.

  • The fingerprint is changed if the inline Ruby code changes it's RBS type declarations -- adding classes, renaming methods, changing method types
  • The fingerprint stays same if the inline Ruby code is updated only for it's implementations -- changing the implementation of def node or adding new lines/white spaces to the source code

Using the method, type checkers can detect if the codebase needs re-type-checking after inline Ruby code edits.

@soutaro soutaro added this to the RBS 4.0 milestone Aug 25, 2025
@ParadoxV5

Copy link
Copy Markdown
Contributor

🧠.

Using full nesting arrays over hashes/checksums… intersting.

@soutaro

soutaro commented Aug 26, 2025

Copy link
Copy Markdown
Member Author

The string digest can be computed with the result of to_json. I want a strict change detection, but the digest on the to_json result would work well usually (with lower memory footprint).

@soutaro
soutaro added this pull request to the merge queue Aug 26, 2025
Merged via the queue into master with commit 90eb909 Aug 26, 2025
32 of 33 checks passed
@soutaro
soutaro deleted the type-finterprint branch August 26, 2025 03:24
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.

2 participants