Skip to content

Add RBS for gli 2.22 - #1108

Merged
github-actions[bot] merged 2 commits into
ruby:mainfrom
apiology:add-gli-signatures
Oct 19, 2026
Merged

github-actions[bot] merged 2 commits into
ruby:mainfrom
apiology:add-gli-signatures

Conversation

@apiology

Copy link
Copy Markdown
Contributor

This PR was written by Claude Code on behalf of @apiology.

Problem

Steep cannot check GLI command-line apps:

class TodoApp
  extend GLI::App
  # Type `singleton(::TodoApp)` does not have method `program_desc`
  program_desc 'Manage a todo list'
end

Every GLI app's DSL calls and action blocks go unchecked.

Solution

Adds RBS for gli 2.22 covering GLI::App, the DSL it shares with GLI::Command, the command objects and option hashes passed to command/action/pre/post/around/on_error blocks, and the exception classes apps rescue or raise.

GLI::Options subclasses OpenStruct in the gem, but RBS 4 ships no OpenStruct signatures (Cannot find type definitions for library: ostruct), so it is declared without a superclass and lists the OpenStruct methods it uses, as gems/config does for Config::Options.

apiology and others added 2 commits October 19, 2026 13:17
Types GLI::App, the DSL it shares with GLI::Command (desc, arg, flag,
switch, command and friends), the command objects yielded to command
blocks, the action/pre/post/around/on_error block parameters, and the
exception classes apps rescue or raise.

GLI::Options subclasses OpenStruct, but RBS 4 has no OpenStruct
signatures (declaring ostruct as a dependency fails with "Cannot find
type definitions for library: ostruct"), so it is declared without a
superclass and with the OpenStruct methods it relies on, as
gems/config does for Config::Options.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Wo4FerFK9aaxrGrmVE9ncZ
Generated with rbs annotate from ri data built from gli v2.22.2
(rdoc --ri lib), the same rdoc-file comment format minitest and
logger use here, so IDEs show gli's own docs on hover. gli is
Apache-2.0. Methods gli marks :nodoc: stay undocumented, so the
hand-written summaries on GLI.run, AppSupport#run and
App#program_name are dropped rather than presented as gli docs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Wo4FerFK9aaxrGrmVE9ncZ
@apiology
apiology marked this pull request as ready for review October 19, 2026 20:01
@github-actions

Copy link
Copy Markdown

@apiology Thanks for your contribution!

Please follow the instructions below for each change.
See also: https://github.com/ruby/gem_rbs_collection/blob/main/docs/CONTRIBUTING.md

Available commands

You can use the following commands by commenting on this PR.

  • /merge: Merge this PR if CI passes

gli

This RBS files are newly added.

You can merge this PR immediately if the CI passes.
Just comment /merge to merge this PR.

@apiology

Copy link
Copy Markdown
Contributor Author

/merge

@github-actions
github-actions Bot merged commit b3dde67 into ruby:main Oct 19, 2026
6 checks passed
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.

1 participant