Skip to content

Explain the assert_never pattern better in agent skills #1598

@nathanjmcdougall

Description

@nathanjmcdougall

Please restore the old pattern

 if default:
    # Register the group - don't do this before adding the deps in case that step fails.
    if backend is BackendEnum.uv:
        register_default_group(group)
    elif backend is BackendEnum.none:
        # This is not really a meaningful concept without a package manager
        pass
    else:
        assert_never(backend)

The rationale being that this makes it safer in case we add a new backend, that we don't silently fail to add support for it here.

Originally posted by @nathanjmcdougall in #1589

We should explain not to remove this pattern when it is encountered, give examples of good and bad; and explain why it's positively helpful for enums in general.

Metadata

Metadata

Labels

agentConfiguration updates for LLM coding agents

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions