Bump black to 20.8b1 (and reformat) (#4371)

* Bump black version

* Reformat with black
This commit is contained in:
jack1142
2020-08-29 19:12:28 +02:00
committed by GitHub
parent 56b54d4d34
commit 85afe19455
30 changed files with 83 additions and 54 deletions

View File

@@ -1422,8 +1422,10 @@ class RedBase(
await self._red_ready.wait()
async def _delete_delay(self, ctx: commands.Context):
"""Currently used for:
* delete delay"""
"""
Currently used for:
* delete delay
"""
guild = ctx.guild
if guild is None:
return

View File

@@ -235,7 +235,7 @@ def parse_cli_flags(args):
help="Set the maximum number of messages to store in the internal message cache.",
)
parser.add_argument(
"--no-message-cache", action="store_true", help="Disable the internal message cache.",
"--no-message-cache", action="store_true", help="Disable the internal message cache."
)
args = parser.parse_args(args)

View File

@@ -1026,7 +1026,7 @@ class Cog(CogMixin, DPYCog, metaclass=DPYCogMeta):
.. warning::
None of your methods should start with ``red_`` or
None of your methods should start with ``red_`` or
be dunder names which start with red (eg. ``__red_test_thing__``)
unless to override behavior in a method designed to be overriden,
as this prefix is reserved for future methods in order to be

View File

@@ -75,7 +75,7 @@ def parse_timedelta(
"""
This converts a user provided string into a timedelta
The units should be in order from largest to smallest.
The units should be in order from largest to smallest.
This works with or without whitespace.
Parameters

View File

@@ -623,7 +623,10 @@ class RedHelpFormatter(HelpFormatterABC):
@staticmethod
async def help_filter_func(
ctx, objects: Iterable[SupportsCanSee], help_settings: HelpSettings, bypass_hidden=False,
ctx,
objects: Iterable[SupportsCanSee],
help_settings: HelpSettings,
bypass_hidden=False,
) -> AsyncIterator[SupportsCanSee]:
"""
This does most of actual filtering.

View File

@@ -443,7 +443,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
await ctx.send(embed=embed)
else:
python_version = "{}.{}.{}".format(*sys.version_info[:3])
dpy_version = "{}".format(discord.__version__,)
dpy_version = "{}".format(discord.__version__)
red_version = "{}".format(__version__)
about = _(

View File

@@ -124,7 +124,7 @@ def cog_data_path(cog_instance=None, raw_name: str = None) -> Path:
Parameters
----------
cog_instance
The instance of the cog you wish to get a data path for.
The instance of the cog you wish to get a data path for.
If calling from a command or method of your cog, this should be ``self``.
raw_name : str
The name of the cog to get a data path for.

View File

@@ -115,7 +115,7 @@ def init_events(bot, cli_flags):
"**we highly recommend you to read the update docs at <{docs}> and "
"make sure there is nothing else that "
"needs to be done during the update.**"
).format(docs="https://docs.discord.red/en/stable/update_red.html",)
).format(docs="https://docs.discord.red/en/stable/update_red.html")
if expected_version(current_python, py_version_req):
installed_extras = []
for extra, reqs in red_pkg._dep_map.items():
@@ -142,8 +142,10 @@ def init_events(bot, cli_flags):
if platform.system() == "Windows"
else _("Terminal")
)
extra_update += '```"{python}" -m pip install -U Red-DiscordBot{package_extras}```'.format(
python=sys.executable, package_extras=package_extras
extra_update += (
'```"{python}" -m pip install -U Red-DiscordBot{package_extras}```'.format(
python=sys.executable, package_extras=package_extras
)
)
else:
@@ -222,7 +224,7 @@ def init_events(bot, cli_flags):
await ctx.send_help()
elif isinstance(error, commands.ArgParserFailure):
msg = _("`{user_input}` is not a valid value for `{command}`").format(
user_input=error.user_input, command=error.cmd,
user_input=error.user_input, command=error.cmd
)
if error.custom_help_msg:
msg += f"\n{error.custom_help_msg}"

View File

@@ -14,9 +14,9 @@ from .utils import AsyncIter
class PrefixManager:
def __init__(self, config: Config, cli_flags: Namespace):
self._config: Config = config
self._global_prefix_overide: Optional[List[str]] = sorted(
cli_flags.prefix, reverse=True
) or None
self._global_prefix_overide: Optional[List[str]] = (
sorted(cli_flags.prefix, reverse=True) or None
)
self._cached: Dict[Optional[int], List[str]] = {}
async def get_prefixes(self, guild: Optional[discord.Guild] = None) -> List[str]:

View File

@@ -154,7 +154,7 @@ async def _sem_wrapper(sem, task):
def bounded_gather_iter(
*coros_or_futures, limit: int = 4, semaphore: Optional[Semaphore] = None,
*coros_or_futures, limit: int = 4, semaphore: Optional[Semaphore] = None
) -> Iterator[Awaitable[Any]]:
"""
An iterator that returns tasks as they are ready, but limits the

View File

@@ -169,7 +169,7 @@ async def close_menu(
def start_adding_reactions(
message: discord.Message, emojis: Iterable[_ReactableEmoji],
message: discord.Message, emojis: Iterable[_ReactableEmoji]
) -> asyncio.Task:
"""Start adding reactions to a message.