Skip to content

feat: ✨ set_constant can raise ValueError#269

Merged
remimd merged 1 commit intodevfrom
constant
Aug 18, 2025
Merged

feat: ✨ set_constant can raise ValueError#269
remimd merged 1 commit intodevfrom
constant

Conversation

@remimd
Copy link
Copy Markdown
Member

@remimd remimd commented Aug 18, 2025

No description provided.

@remimd remimd requested a review from Copilot August 18, 2025 12:21
@remimd remimd self-assigned this Aug 18, 2025
Copy link
Copy Markdown

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 pull request enhances the set_constant method to improve its API design and error handling. The main purpose is to make set_constant return the instance being registered and add validation when using type aliases.

  • Modified set_constant to return the registered instance instead of self for better method chaining
  • Added validation to raise ValueError when alias=True but no on parameter is provided
  • Updated documentation to demonstrate the improved API usage

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
injection/_core/module.py Core implementation changes to return instance and add alias validation
injection/__init__.pyi Updated type stub to reflect new return type
tests/core/test_module.py Added test coverage for the new ValueError and renamed existing test
documentation/basic-usage.md Updated example to show improved usage pattern
documentation/entrypoint.md Fixed function call by removing extra parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@remimd remimd merged commit 53f7e47 into dev Aug 18, 2025
5 checks passed
@remimd remimd deleted the constant branch August 18, 2025 12:23
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