[Junie]: Schemaジェネリックラッパー追加とIDE補完対応プルリクレビュー#12
Conversation
| collect_errors: bool = ..., | ||
| *, | ||
| collect_errors: Literal[True], | ||
| ) -> ValidationResult: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
Copilot Autofix
AI about 12 hours ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
| collect_errors: bool = ..., | ||
| *, | ||
| collect_errors: Literal[True], | ||
| ) -> ValidationResult: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 12 hours ago
In general, to fix "statement has no effect" warnings where ... is used as a function body, replace the bare ellipsis expression with pass, which is the idiomatic no‑op statement in Python. This keeps the function as a stub without changing behavior.
Here, each overload in the if TYPE_CHECKING: block ends with ) -> ...: .... The ellipsis body is only there as a placeholder, so the best fix is to change ... to pass on each overload definition, including the one on line 204 that CodeQL highlights. This keeps the overloads valid and understandable to type checkers and human readers, while eliminating the no‑effect expression statement. No imports or additional definitions are required.
Concretely, in src/validkit/validator.py, within the if TYPE_CHECKING: block starting around line 171, update all four def validate(...) -> ...: ... overloads so their bodies are pass instead of ....
| @@ -179,7 +179,8 @@ | ||
| migrate: Optional[Dict[str, Any]] = ..., | ||
| *, | ||
| collect_errors: Literal[True], | ||
| ) -> ValidationResult: ... | ||
| ) -> ValidationResult: | ||
| pass | ||
|
|
||
| @overload | ||
| def validate( | ||
| @@ -190,7 +191,8 @@ | ||
| migrate: Optional[Dict[str, Any]] = ..., | ||
| *, | ||
| collect_errors: Literal[False] = ..., # default | ||
| ) -> T: ... | ||
| ) -> T: | ||
| pass | ||
|
|
||
| @overload | ||
| def validate( | ||
| @@ -201,7 +203,8 @@ | ||
| migrate: Optional[Dict[str, Any]] = ..., | ||
| *, | ||
| collect_errors: Literal[True], | ||
| ) -> ValidationResult: ... | ||
| ) -> ValidationResult: | ||
| pass | ||
|
|
||
| @overload | ||
| def validate( | ||
| @@ -212,7 +215,8 @@ | ||
| migrate: Optional[Dict[str, Any]] = ..., | ||
| *, | ||
| collect_errors: Literal[False] = ..., # default | ||
| ) -> Any: ... | ||
| ) -> Any: | ||
| pass | ||
|
|
||
|
|
||
| def validate( |
f4b7781
into
copilot/add-type-hints-to-validate-function
📌 Hey! This PR was made for you with Junie, the coding agent by JetBrains Early Access Preview
It's still learning, developing, and might make mistakes. Please make sure you review the changes before you accept them.
We'd love your feedback — join our Discord to share bugs, ideas: here.
Schema[T]generic wrapper and type-safe@overloadsignatures to enable IDE type completion onvalidatereturn values #9📊 Junie Summary
Empty