KotlinIsland / KotlinIsland/basedmypy
a better plugin interface
- Dominant language
- Python
- Stars
- 202
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
```py
class MyPlugin(Plugin):
default_error_code = ErrorCode("my-code", "", "")
@hook_function(mypackage.mymodule.mydef)
def _(self, ctx: FunctionContext):
if isinstance(ctx.arg_types[0][0], NoneType):
self.fail("epic fail")
```
We can wrap up hook functions with a nice decorator, have a `fail` function that uses a stateful context. Optional return type to use the default. default error code.
and send a detailed version object instead of a string
Contributor guide
Research direction
Start by locating the existing Plugin, hook_function, FunctionContext, and error-code interfaces referenced in the example. Define the desired decorator, stateful failure handling, default error code, optional return behavior, and detailed version object, then verify the interface with the project's existing plugin checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100