From ab7fa917c07cbb3d646b1a61b300357246ba8842 Mon Sep 17 00:00:00 2001 From: LordOfPolls Date: Tue, 20 Sep 2022 17:59:23 +0100 Subject: [PATCH] docs: remove redundant todos If you think they shouldn't be removed, action them --- naff/api/gateway/gateway.py | 1 - naff/api/http/http_requests/guild.py | 2 +- naff/api/voice/encryption.py | 2 +- naff/api/voice/opus.py | 2 +- naff/client/mixins/serialization.py | 1 - naff/models/discord/base.py | 1 - naff/models/discord/color.py | 2 +- naff/models/discord/guild.py | 1 - tests/test_bot.py | 1 - 9 files changed, 4 insertions(+), 9 deletions(-) diff --git a/naff/api/gateway/gateway.py b/naff/api/gateway/gateway.py index 149cb4759..d2d6c1ace 100644 --- a/naff/api/gateway/gateway.py +++ b/naff/api/gateway/gateway.py @@ -214,7 +214,6 @@ async def dispatch_event(self, data, seq, event) -> None: ) logger.info(f"Shard {self.shard[0]} has connected to gateway!") logger.debug(f"Session ID: {self.session_id} Trace: {self._trace}") - # todo: future polls, improve guild caching here. run the debugger. you'll see why return self.state.client.dispatch(events.WebsocketReady(data)) case "RESUMED": diff --git a/naff/api/http/http_requests/guild.py b/naff/api/http/http_requests/guild.py index 9a8e43cbf..b49b4dbd8 100644 --- a/naff/api/http/http_requests/guild.py +++ b/naff/api/http/http_requests/guild.py @@ -133,7 +133,7 @@ async def modify_guild( ) payload = kwargs.copy() for key, value in kwargs.items(): - if key not in expected or value is None: # todo review + if key not in expected or value is None: del payload[key] # only do the request if there is something to modify diff --git a/naff/api/voice/encryption.py b/naff/api/voice/encryption.py index 3d7ad1b01..661bcf36d 100644 --- a/naff/api/voice/encryption.py +++ b/naff/api/voice/encryption.py @@ -32,7 +32,7 @@ def encrypt(self, mode: str, header: bytes, data) -> bytes: raise RuntimeError(f"Unsupported encryption type requested: {mode}") def xsalsa20_poly1305_lite(self, header: bytes, data) -> bytes: - # todo: hi! + # todo: redundant but might be useful for some weird edge case ... def xsalsa20_poly1305_suffix(self, header: bytes, data) -> bytes: diff --git a/naff/api/voice/opus.py b/naff/api/voice/opus.py index 8279f01b9..67ced9ff1 100644 --- a/naff/api/voice/opus.py +++ b/naff/api/voice/opus.py @@ -216,7 +216,7 @@ def set_expected_pack_loss(self, expected_packet_loss: float) -> None: self.lib_opus.opus_encoder_ctl(self.encoder, EncoderCTL.CTL_SET_PLP, self.expected_packet_loss) def encode(self, pcm: bytes) -> bytes: - """todo: doc""" + """Encode a frame of audio""" max_data_bytes = len(pcm) pcm = ctypes.cast(pcm, c_int16_ptr) data = (ctypes.c_char * max_data_bytes)() diff --git a/naff/client/mixins/serialization.py b/naff/client/mixins/serialization.py index f1d483fcb..c1bfe594c 100644 --- a/naff/client/mixins/serialization.py +++ b/naff/client/mixins/serialization.py @@ -91,7 +91,6 @@ def update_from_dict(self: Type[const.T], data: Dict[str, Any]) -> const.T: """ data = self._process_dict(data) for key, value in self._filter_kwargs(data, self._get_keys()).items(): - # todo improve setattr(self, key, value) return self diff --git a/naff/models/discord/base.py b/naff/models/discord/base.py index f1d0759d4..9c80ae56e 100644 --- a/naff/models/discord/base.py +++ b/naff/models/discord/base.py @@ -34,7 +34,6 @@ def from_list(cls: Type[T], datas: List[Dict[str, Any]], client: "Client") -> Li def update_from_dict(self, data) -> T: data = self._process_dict(data, self._client) for key, value in self._filter_kwargs(data, self._get_keys()).items(): - # todo improve setattr(self, key, value) return self diff --git a/naff/models/discord/color.py b/naff/models/discord/color.py index cb704f881..632e45b68 100644 --- a/naff/models/discord/color.py +++ b/naff/models/discord/color.py @@ -42,7 +42,7 @@ def __init__(self, color: COLOR_TYPES | None = None) -> None: if re.match(hex_regex, color): self.hex = color else: - self.value = BrandColors[color].value # todo exception handling for better message + self.value = BrandColors[color].value else: raise TypeError diff --git a/naff/models/discord/guild.py b/naff/models/discord/guild.py index 9e6f2bbda..cf966f595 100644 --- a/naff/models/discord/guild.py +++ b/naff/models/discord/guild.py @@ -218,7 +218,6 @@ class Guild(BaseGuild): @classmethod def _process_dict(cls, data: Dict[str, Any], client: "Client") -> Dict[str, Any]: - # todo: find a away to prevent this loop from blocking the event loop data = super()._process_dict(data, client) guild_id = data["id"] diff --git a/tests/test_bot.py b/tests/test_bot.py index 3368bb3db..994bef9bb 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -117,7 +117,6 @@ async def test_channels(bot: Client, guild: Guild) -> None: assert channel.category == guild_category if isinstance(channel, MessageableMixin) and not isinstance(channel, GuildVoice): - # todo: remove the guild voice exception when text-in-voice releases _m = await channel.send("test") assert _m.channel == channel