Skip to content

Conversation

@cardmagic
Copy link
Owner

Summary

Add RBS type signatures to enable static type checking and improved IDE support.

Closes #45

Changes

  • Add sig/ directory with RBS type definitions for all public APIs
  • Add RBS validation step to CI workflow

Files added

sig/
  classifier.rbs
  classifier/bayes.rbs
  classifier/lsi.rbs
  classifier/lsi/content_node.rbs
  classifier/lsi/word_list.rbs
  classifier/extensions/object.rbs
  classifier/extensions/string.rbs
  classifier/extensions/vector.rbs

Test plan

  • All existing tests pass
  • rbs -I sig validate passes locally
  • CI validates RBS types

@cardmagic cardmagic requested a review from Copilot December 27, 2025 05:45
@cardmagic cardmagic self-assigned this Dec 27, 2025
Copy link

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 adds RBS (Ruby Signature) type definitions to enable static type checking and improved IDE support for the Classifier gem. The changes introduce type signatures for all public APIs across the codebase and integrate RBS validation into the CI pipeline.

Key changes:

  • Complete RBS type definitions for core classifier classes (Bayes, LSI) and supporting components
  • Type signatures for Ruby standard library extensions (String, Array, Vector, Matrix, Object)
  • CI workflow enhancement to validate RBS types on each build

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sig/classifier.rbs Root module declaration for Classifier namespace
sig/classifier/bayes.rbs Type signatures for Bayesian classifier including training and classification methods
sig/classifier/lsi.rbs Type signatures for LSI classifier with comprehensive API coverage
sig/classifier/lsi/content_node.rbs Type definitions for LSI content node representation
sig/classifier/lsi/word_list.rbs Type signatures for word indexing and lookup functionality
sig/classifier/extensions/object.rbs Type signature for Object class extension
sig/classifier/extensions/string.rbs Type signatures for String extensions including text processing methods
sig/classifier/extensions/vector.rbs Type signatures for Vector/Matrix extensions and Array enhancements
.github/workflows/ruby.yml Adds RBS validation step to CI workflow

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

The previous commit added RBS type signatures and CI validation,
but the workflow failed because the rbs gem was not installed.
This adds a gem install step before running the validation command.
@cardmagic cardmagic merged commit 9ad363d into master Dec 27, 2025
4 checks passed
@cardmagic cardmagic deleted the feature/rbs-types branch December 27, 2025 05:49
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.

Add RBS type signatures

2 participants