feat: rename the tool-name attribute from name to tool_name - #28
Merged
Conversation
bhirsz
force-pushed
the
refactor/tool-name-attr
branch
from
August 30, 2026 13:32
617f17f to
02732ee
Compare
bhirsz
force-pushed
the
refactor/tool-name-attr
branch
from
August 30, 2026 13:34
02732ee to
4843d19
Compare
The ArgConfig class attribute that sets the tool name was called `name`, which squatted on a very common option name: a subclass could not declare its own `name` option (the robot example had to use an ugly `name_`). Rename the attribute to `tool_name` so `name` is free for user options. The resolved (non-optional) value is now exposed as the `resolved_tool_name` property. The robot example now declares a natural `name` option. Migration (pre-1.0): rename `name = "..."` to `tool_name = "..."` on your ArgConfig subclasses. If you read the resolved name off an instance, use `resolved_tool_name` instead of `tool_name`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bhirsz
force-pushed
the
refactor/tool-name-attr
branch
from
August 30, 2026 13:34
4843d19 to
71c08b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renames the
ArgConfigtool-name class attribute fromnametotool_name.The old
nameattribute squatted on a very common option name: a subclass could not declare its ownnameoption. The Robot Framework example had to work around this with an uglyname_attribute mapped to--name. With this change,nameis free for user options and the example declares a naturalname.Changes
base.py: the settable attribute is nowtool_name; the resolved (non-optional, class-name fallback) value is exposed as the newresolved_tool_nameproperty.processor.py: usesresolved_tool_namefor env-var and user-config-dir lookups.tests/robot_cli.py) now declaresname: str | None = option(name="name", ...)and dropsname_.tool_name = "...".Migration (pre-1.0)
name = "..."→tool_name = "..."on yourArgConfigsubclasses.resolved_tool_nameinstead oftool_name.No stability guarantees yet (alpha); documented inline rather than as a breaking-change footer per the project's pre-1.0 policy.
All 230 tests pass; ruff + mypy clean.