Skip to content

Add RBS typesΒ #148

@mscwilson

Description

@mscwilson

Currently, this tracker uses the Contracts gem. All the public API methods have type checking.

There are a couple of downsides to this. Users who have a Contract class or module in their codebase have a name clash problem. Also, a broken Contract throws an Error, not a warning - mistakes in setting up tracking can lead to RuntimeErrors. Perhaps it would be better to catch mistakes elsewhere in the pipeline?

Ruby 3 introduced a native type checking system called Ruby Signatures. Each .rb file can have a matching .rbs file where the type signature is defined. Although according to this JetBrains survey most Ruby users currently use Ruby 2.7, this is the future of Ruby so it would be great to migrate away from Contracts in favour of RBS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:enhancementNew features or improvements to existing features.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions