Skip to content

Handle disabled collection configuration - #3112

Closed
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/collection-no-config
Closed

Handle disabled collection configuration#3112
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/collection-no-config

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary: let collection help work with disabled collection configuration and return a clear failure for commands that require configuration, instead of raising from a missing path.

Verification: focused baseline/fixed reproduction, combined RBS 4.2.0 consumer models, and RuboCop (738 files, zero offenses). No tests are added in this PR.

Compatibility: no public API removal or dependency/version change.

@pocke pocke self-assigned this Sep 7, 2026
@pocke

pocke commented Sep 7, 2026

Copy link
Copy Markdown
Member

Thank you for the patch, and sorry for the slow reply. I am going to close this one.

You are right that the current code is bad: rbs --no-collection collection install dies with a bare RuntimeError carrying an empty message, and I reproduced that. But I do not think the combination is worth supporting.

--no-collection is not an option of the collection subcommand. It belongs to LibraryOptions, and its only job is to make LibraryOptions#loader skip add_collection, so that rbs list, rbs ast, rbs validate and friends can build an environment without pulling in the gem RBS collection. run_collection only sees the nil because every subcommand is handed the same options object. --no-collection and the config_path = options.config_path or raise line were in fact added in the same commit (38fd8b2, the one that introduced rbs collection), so combining the two was never something we meant to support. Asking rbs collection to run while telling rbs to ignore the collection configuration does not describe anything a user wants.

On the help branch specifically: I do not see what it buys us. rbs collection help already works without --no-collection, and nobody is going to pass --no-collection in order to read the help text. Lifting one branch out of the case to serve that combination costs more in readability than the behaviour is worth.

So we would be adding code, and a user-facing error message, for an invocation that has no meaning. I would rather leave the surface as it is.

If you have run into this for real -- a wrapper or an alias that always passes --no-collection, say -- please tell me. A concrete case would change my mind, and then I would want the fix to be just the nil check, without the help special case.

@pocke pocke closed this Sep 7, 2026
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