Skip to content

Commit

Permalink
Improve docstring formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hypergonial committed May 24, 2024
1 parent 8e5f028 commit aae8df8
Show file tree
Hide file tree
Showing 28 changed files with 56 additions and 89 deletions.
30 changes: 15 additions & 15 deletions arc/abc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def walk_commands( # noqa: C901
CommandT[te.Self]
The next command that matches the given criteria.
Examples
Example
--------
```py
for cmd in plugin.walk_commands(hikari.CommandType.SLASH):
Expand Down Expand Up @@ -561,7 +561,7 @@ def include(
RuntimeError
If the command is already added to a plugin.
Examples
Example
--------
```py
@client.include # Add the command to the client.
Expand Down Expand Up @@ -637,7 +637,7 @@ def include_slash_group(
!!! note
Parameters left as `hikari.UNDEFINED` will be inherited from the parent client.
Examples
Example
--------
```py
group = client.include_slash_group("Group", "A group of commands.")
Expand Down Expand Up @@ -891,7 +891,7 @@ def set_error_handler(
te.Self
The client for chaining calls.
Examples
Example
--------
```py
@client.set_error_handler
Expand Down Expand Up @@ -942,7 +942,7 @@ def add_startup_hook(
te.Self
The client for chaining calls.
Examples
Example
--------
```py
@client.add_startup_hook
Expand Down Expand Up @@ -989,7 +989,7 @@ def add_shutdown_hook(
te.Self
The client for chaining calls.
Examples
Example
--------
```py
@client.add_shutdown_hook
Expand Down Expand Up @@ -1040,7 +1040,7 @@ def set_startup_hook(
te.Self
The client for chaining calls.
Examples
Example
--------
```py
@client.set_startup_hook
Expand Down Expand Up @@ -1092,7 +1092,7 @@ def set_shutdown_hook(
te.Self
The client for chaining calls.
Examples
Example
--------
```py
@client.set_shutdown_hook
Expand Down Expand Up @@ -1140,7 +1140,7 @@ def set_command_locale_provider(
te.Self
The client for chaining calls.
Examples
Example
--------
```py
@client.set_command_locale_provider
Expand Down Expand Up @@ -1187,7 +1187,7 @@ def set_option_locale_provider(
te.Self
The client for chaining calls.
Examples
Example
--------
```py
@client.set_option_locale_provider
Expand Down Expand Up @@ -1229,7 +1229,7 @@ def set_custom_locale_provider(
provider : CustomLocaleRequestT
The custom locale provider to set.
Examples
Example
--------
```py
@client.set_custom_locale_provider
Expand Down Expand Up @@ -1272,7 +1272,7 @@ def load_extension(self, path: str) -> te.Self:
ValueError
If the module does not have a loader.
Examples
Example
--------
```py
client = arc.GatewayClient(...)
Expand Down Expand Up @@ -1337,7 +1337,7 @@ def load_extensions_from(self, dir_path: str | pathlib.Path, recursive: bool = F
ExtensionLoadError
If a module does not have a loader defined.
Examples
Example
--------
```py
client = arc.GatewayClient(...)
Expand Down Expand Up @@ -1438,7 +1438,7 @@ def set_type_dependency(self, type_: type[T], instance: T) -> te.Self:
te.Self
The client for chaining calls.
Examples
Example
--------
```py
class MyDependency:
Expand Down Expand Up @@ -1513,7 +1513,7 @@ def inject_dependencies(
Command callbacks are automatically injected with dependencies,
thus this decorator is not needed for them.
Examples
Example
--------
```py
class MyDependency:
Expand Down
2 changes: 1 addition & 1 deletion arc/abc/concurrency_limiting.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def with_concurrency_limit(
t.Callable[[HasConcurrencyLimiterT], HasConcurrencyLimiterT]
The object with the concurrency limiter set.
Examples
Example
--------
```py
@client.include
Expand Down
2 changes: 1 addition & 1 deletion arc/abc/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def set_error_handler(
This function will be called when an exception is raised during the invocation of a command.
Examples
Example
--------
```py
@client.include
Expand Down
4 changes: 2 additions & 2 deletions arc/abc/hookable.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def with_hook(hook: HookT[ClientT]) -> t.Callable[[HookableT], HookableT]:
and returns either a [`HookResult`][arc.abc.hookable.HookResult] or
`None` can be used as a hook.
Examples
Example
--------
```py
@client.include
Expand Down Expand Up @@ -127,7 +127,7 @@ def with_post_hook(hook: PostHookT[ClientT]) -> t.Callable[[HookableT], Hookable
Post-execution hooks **are** called even if the command callback raises an exception.
You can see if the command callback failed by checking [`Context.has_command_failed`][arc.context.base.Context.has_command_failed].
Examples
Example
--------
```py
@client.include
Expand Down
2 changes: 1 addition & 1 deletion arc/abc/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
Option = t.Annotated
"""Alias for typing.Annotated.
Examples
Example
--------
```py
arc.Option[type, arc.TypeParams(...)]
Expand Down
6 changes: 3 additions & 3 deletions arc/abc/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def include_slash_group(
!!! note
Parameters left as `hikari.UNDEFINED` will be inherited from the parent plugin or client.
Examples
Example
--------
```py
group = client.include_slash_group("Group", "A group of commands.")
Expand Down Expand Up @@ -340,7 +340,7 @@ def inject_dependencies(
Command callbacks are automatically injected with dependencies,
thus this decorator is not needed for them.
Examples
Example
--------
```py
class MyDependency:
Expand Down Expand Up @@ -439,7 +439,7 @@ def walk_commands( # noqa: C901
CommandT[ClientT]
The next command that matches the given criteria.
Examples
Example
--------
```py
for cmd in plugin.walk_commands(hikari.CommandType.SLASH):
Expand Down
4 changes: 2 additions & 2 deletions arc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class GatewayClient(GatewayClientBase[hikari.GatewayBotAware]):
If you already have an injector instance, you may pass it here.
Otherwise, a new one will be created by default.
Examples
Example
--------
```py
import hikari
Expand Down Expand Up @@ -390,7 +390,7 @@ class RESTClient(RESTClientBase[hikari.RESTBotAware]):
Otherwise, a new one will be created by default.
Examples
Example
--------
```py
import hikari
Expand Down
2 changes: 1 addition & 1 deletion arc/command/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def message_command(
name_localizations : t.Mapping[hikari.Locale, str] | None
The localizations for this command's name.
Examples
Example
--------
```py
@client.include
Expand Down
3 changes: 0 additions & 3 deletions arc/command/option/attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class AttachmentParams(OptionParams[hikari.Attachment]):
----------
description : str
The description of the option
Other Parameters
----------------
name : str
The name of the option. If not provided, the name of the parameter will be used.
name_localizations : Mapping[hikari.Locale, str] | None
Expand Down
3 changes: 0 additions & 3 deletions arc/command/option/bool.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class BoolParams(OptionParams[bool]):
----------
description : str
The description of the option
Other Parameters
----------------
name : str
The name of the option. If not provided, the name of the parameter will be used.
name_localizations : t.Optional[t.Mapping[str, str]]
Expand Down
3 changes: 0 additions & 3 deletions arc/command/option/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ class ChannelParams(OptionParams[hikari.PartialChannel]):
----------
description : str
The description of the option
Other Parameters
----------------
name : str
The name of the option. If not provided, the name of the parameter will be used.
name_localizations : Mapping[hikari.Locale, str]
Expand Down
3 changes: 0 additions & 3 deletions arc/command/option/custom/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ class ColorParams(OptionParams[hikari.Color]):
----------
description : str
The description of the option
Other Parameters
----------------
name : str
The name of the option. If not provided, the name of the parameter will be used.
name_localizations : Mapping[hikari.Locale, str] | None
Expand Down
3 changes: 0 additions & 3 deletions arc/command/option/custom/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ class MemberParams(OptionParams[hikari.InteractionMember]):
----------
description : str
The description of the option
Other Parameters
----------------
name : str
The name of the option. If not provided, the name of the parameter will be used.
name_localizations : Mapping[hikari.Locale, str] | None
Expand Down
3 changes: 0 additions & 3 deletions arc/command/option/float.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class FloatParams(OptionWithChoicesParams[float, ClientT]):
----------
description : str
The description of the option
Other Parameters
----------------
name : str
The name of the option. If not provided, the name of the parameter will be used.
name_localizations : Mapping[hikari.Locale, str] | None
Expand Down
3 changes: 0 additions & 3 deletions arc/command/option/int.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class IntParams(OptionWithChoicesParams[int, ClientT]):
----------
description : str
The description of the option
Other Parameters
----------------
name : str
The name of the option. If not provided, the name of the parameter will be used.
name_localizations : Mapping[hikari.Locale, str] | None
Expand Down
3 changes: 0 additions & 3 deletions arc/command/option/mentionable.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ class MentionableParams(OptionParams[hikari.Role | hikari.User]):
----------
description : str
The description of the option
Other Parameters
----------------
name : str
The name of the option. If not provided, the name of the parameter will be used.
name_localizations : Mapping[hikari.Locale, str] | None
Expand Down
3 changes: 0 additions & 3 deletions arc/command/option/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class RoleParams(OptionParams[hikari.Role]):
----------
description : str
The description of the option
Other Parameters
----------------
name : str
The name of the option. If not provided, the name of the parameter will be used.
name_localizations : t.Optional[t.Mapping[str, str]]
Expand Down
3 changes: 0 additions & 3 deletions arc/command/option/str.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ class StrParams(OptionWithChoicesParams[str, ClientT]):
----------
description : str
The description of the option
Other Parameters
----------------
name : str
The name of the option. If not provided, the name of the parameter will be used.
name_localizations : Mapping[hikari.Locale, str]
Expand Down
3 changes: 0 additions & 3 deletions arc/command/option/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ class UserParams(OptionParams[hikari.User]):
----------
description : str
The description of the option
Other Parameters
----------------
name : str
The name of the option. If not provided, the name of the parameter will be used.
name_localizations : Mapping[hikari.Locale, str] | None
Expand Down
4 changes: 2 additions & 2 deletions arc/command/slash.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ def slash_command(
!!! note
Parameters left as `hikari.UNDEFINED` will be inherited from the parent plugin or client.
Examples
Example
--------
```py
@client.include
Expand Down Expand Up @@ -843,7 +843,7 @@ def slash_subcommand(
!!! note
Parameters left as `hikari.UNDEFINED` will be inherited from the parent group, plugin or client.
Examples
Example
--------
```py
group = client.include_slash_group("group", "A group of slash commands.")
Expand Down
2 changes: 1 addition & 1 deletion arc/command/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def user_command(
name_localizations : t.Mapping[hikari.Locale, str] | None
The localizations for this command's name.
Examples
Example
--------
```py
@client.include
Expand Down
2 changes: 1 addition & 1 deletion arc/context/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def get_option(self, name: str, opt_type: OptionType) -> t.Any | None:
ValueT | None
The value of the option, or None if it does not exist, or is not of the correct type.
Examples
Example
--------
```py
value = ctx.get_option("name", arc.OptionType.STRING)
Expand Down
4 changes: 2 additions & 2 deletions arc/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def loader(
) -> t.Callable[[ClientT], None] | t.Callable[[t.Callable[[ClientT], None]], t.Callable[[ClientT], None]]:
"""Decorator to set the load callback for this module.
Examples
Example
--------
```py
client.load_extension("my_extension")
Expand Down Expand Up @@ -61,7 +61,7 @@ def unloader(
) -> t.Callable[[ClientT], None] | t.Callable[[t.Callable[[ClientT], None]], t.Callable[[ClientT], None]]:
"""Decorator to set the unload callback for this module.
Examples
Example
--------
```py
client.unload_extension("my_extension")
Expand Down
Loading

0 comments on commit aae8df8

Please sign in to comment.