Skip to content

Commit

Permalink
Fix various spelling mistakes (#1028)
Browse files Browse the repository at this point in the history
* Fix various spelling mistakes

* Fix a few spelling mistakes
  • Loading branch information
Neon Jonn authored Feb 24, 2022
1 parent 50f950a commit 4936222
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
test:
strategy:
# Allows for matrix sub-jobs to fail without canceling the rest
# Allows for matrix sub-jobs to fail without cancelling the rest
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: true

jobs:
prepare-relese:
prepare-release:
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Bugfixes
- Fix `PartialSticker.image_url` not passing the hash as a string ([#930](https://github.com/hikari-py/hikari/issues/930))
- Fixed the url being generated for role icons to not erroneously insert ".png" before the file extension ([#931](https://github.com/hikari-py/hikari/issues/931))
- Fix some bugs in message deserialization
- Remove case for setting `member` and `referece_message` to `undefined.Undefined` in full message deserialization
- Remove case for setting `member` and `reference_message` to `undefined.Undefined` in full message deserialization
- Don't set `message.member` to `undefined.UNDEFINED` on partial message deserialization if message was sent by a webhook ([#933](https://github.com/hikari-py/hikari/issues/933))


Expand Down
2 changes: 1 addition & 1 deletion hikari/api/interaction_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"""Type hint of a Interaction server's listener callback.
This should be an async callback which takes in one positional argument which
subclases `hikari.interactions.base_interactions.PartialInteraction` and may return an
subclasses `hikari.interactions.base_interactions.PartialInteraction` and may return an
instance of the relevant `hikari.api.special_endpoints.InteractionResponseBuilder`
subclass for the provided interaction type which will instruct the server on how
to respond.
Expand Down
12 changes: 6 additions & 6 deletions hikari/api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,7 @@ async def fetch_webhook(
Other Parameters
----------------
token : hikari.undefined.UndefinedOr[builtins.str]
If provided, the webhoook token that will be used to fetch
If provided, the webhook token that will be used to fetch
the webhook instead of the token the client was initialized with.
Returns
Expand Down Expand Up @@ -2125,7 +2125,7 @@ async def edit_webhook(
Other Parameters
----------------
token : hikari.undefined.UndefinedOr[builtins.str]
If provided, the webhoook token that will be used to edit
If provided, the webhook token that will be used to edit
the webhook instead of the token the client was initialized with.
name : hikari.undefined.UndefinedOr[builtins.str]
If provided, the new webhook name.
Expand Down Expand Up @@ -2185,7 +2185,7 @@ async def delete_webhook(
Other Parameters
----------------
token : hikari.undefined.UndefinedOr[builtins.str]
If provided, the webhoook token that will be used to delete
If provided, the webhook token that will be used to delete
the webhook instead of the token the client was initialized with.
Raises
Expand All @@ -2196,7 +2196,7 @@ async def delete_webhook(
hikari.errors.UnauthorizedError
If you are unauthorized to make the request (invalid/missing token).
hikari.errors.NotFoundError
If the webhoook is not found.
If the webhook is not found.
hikari.errors.RateLimitTooLongError
Raised in the event that a rate limit occurs that is
longer than `max_rate_limit` when making a request.
Expand Down Expand Up @@ -2885,7 +2885,7 @@ def fetch_my_guilds(
Other Parameters
----------------
newest_first : builtins.bool
Whether to fetch the newest first or the olders first.
Whether to fetch the newest first or the oldest first.
Defaults to `builtins.False`.
start_at : hikari.undefined.UndefinedOr[hikari.snowflakes.SearchableSnowflakeishOr[hikari.guilds.PartialGuild]]
If provided, will start at this snowflake. If you provide
Expand Down Expand Up @@ -7234,7 +7234,7 @@ async def fetch_application_command_permissions(
guild : hikari.undefined.UndefinedOr[hikari.snowflakes.SnowflakeishOr[hikari.guilds.PartialGuild]]
Object or ID of the guild to fetch the command permissions for.
command: hikari.snowflakes.SnowflakeishOr[hikari.commands.PartialCommand]
Objecr or ID of the command to fetch the command permissions for.
Object or ID of the command to fetch the command permissions for.
Returns
-------
Expand Down
4 changes: 2 additions & 2 deletions hikari/guilds.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def mention(self) -> str:
def communication_disabled_until(self) -> typing.Optional[datetime.datetime]:
"""Return when the timeout for this member ends.
Unlike `raw_communictation_disabled_until`, this will always be
Unlike `raw_communication_disabled_until`, this will always be
`builtins.None` if the member is not currently timed out.
!!! note
Expand Down Expand Up @@ -3334,7 +3334,7 @@ async def fetch_public_updates_channel(self) -> typing.Optional[channels_.GuildT
Returns
-------
typing.Optional[hikari.channels.GuildTextChannel]
The channel where discord sents relevant updates to moderators and admins.
The channel where discord sends relevant updates to moderators and admins.
Raises
------
Expand Down
12 changes: 6 additions & 6 deletions hikari/impl/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ async def on_everyone_mentioned(event):
Listen: `hikari.impl.bot.GatewayBot.listen`
Stream: `hikari.impl.bot.GatewayBot.stream`
Subscribe: `hikari.impl.bot.GatewayBot.subscribe`
Unubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
Unsubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
Wait_for: `hikari.impl.bot.GatewayBot.wait_for`
"""
return self._event_manager.dispatch(event)
Expand Down Expand Up @@ -643,7 +643,7 @@ def listen(
Dispatch: `hikari.impl.bot.GatewayBot.dispatch`
Stream: `hikari.impl.bot.GatewayBot.stream`
Subscribe: `hikari.impl.bot.GatewayBot.subscribe`
Unubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
Unsubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
Wait_for: `hikari.impl.bot.GatewayBot.wait_for`
"""
return self._event_manager.listen(event_type)
Expand Down Expand Up @@ -735,7 +735,7 @@ def run(
close_loop : builtins.bool
Defaults to `builtins.True`. If `builtins.True`, then once the bot
enters a state where all components have shut down permanently
during application shutdown, then all asyngens and background tasks
during application shutdown, then all asyncgens and background tasks
will be destroyed, and the event loop will be shut down.
This will wait until all `hikari`-owned `aiohttp` connectors have
Expand Down Expand Up @@ -1152,7 +1152,7 @@ def stream(
Dispatch: `hikari.impl.bot.GatewayBot.dispatch`
Listen: `hikari.impl.bot.GatewayBot.listen`
Subscribe: `hikari.impl.bot.GatewayBot.subscribe`
Unubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
Unsubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
Wait_for: `hikari.impl.bot.GatewayBot.wait_for`
"""
self._check_if_alive()
Expand Down Expand Up @@ -1191,7 +1191,7 @@ async def on_message(event):
Dispatch: `hikari.impl.bot.GatewayBot.dispatch`
Listen: `hikari.impl.bot.GatewayBot.listen`
Stream: `hikari.impl.bot.GatewayBot.stream`
Unubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
Unsubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
Wait_for: `hikari.impl.bot.GatewayBot.wait_for`
"""
self._event_manager.subscribe(event_type, callback)
Expand Down Expand Up @@ -1279,7 +1279,7 @@ async def wait_for(
Listen: `hikari.impl.bot.GatewayBot.listen`
Stream: `hikari.impl.bot.GatewayBot.stream`
Subscribe: `hikari.impl.bot.GatewayBot.subscribe`
Unubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
Unsubscribe: `hikari.impl.bot.GatewayBot.unsubscribe`
"""
self._check_if_alive()
return await self._event_manager.wait_for(event_type, timeout=timeout, predicate=predicate)
Expand Down
2 changes: 1 addition & 1 deletion hikari/impl/event_manager_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async def __aenter__(self: _EventStreamT) -> _EventStreamT:
# This is sync only.
warnings.warn(
"Using EventStream as an async context manager has been deprecated since 2.0.0.dev104. "
"Please use it as a sycnrhonous context manager (e.g. with bot.stream(...)) instead.",
"Please use it as a synchronous context manager (e.g. with bot.stream(...)) instead.",
category=DeprecationWarning,
stacklevel=2,
)
Expand Down
2 changes: 1 addition & 1 deletion hikari/impl/interaction_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ async def aiohttp_hook(self, request: aiohttp.web.Request) -> aiohttp.web.Respon
Returns
-------
aiohtttp.web.Response
aiohttp.web.Response
The aiohttp response.
"""
if request.content_type.lower() != _JSON_CONTENT_TYPE:
Expand Down
2 changes: 1 addition & 1 deletion hikari/impl/rate_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class WindowedBurstRateLimiter(BurstRateLimiter):
Rate limiter for rate limits that last fixed periods of time with a
fixed number of times it can be used in that time frame.
To use this, you should call WindowedBurstRateLimiter.aquire` and await the
To use this, you should call WindowedBurstRateLimiter.acquire` and await the
result immediately before performing your rate-limited task.
If the rate limit has been hit, acquiring time will return an incomplete
Expand Down
2 changes: 1 addition & 1 deletion hikari/impl/rest_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def run(
close_loop : builtins.bool
Defaults to `builtins.True`. If `builtins.True`, then once the bot
enters a state where all components have shut down permanently
during application shutdown, then all asyngens and background tasks
during application shutdown, then all asyncgens and background tasks
will be destroyed, and the event loop will be shut down.
This will wait until all `hikari`-owned `aiohttp` connectors have
Expand Down
2 changes: 1 addition & 1 deletion hikari/internal/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def split(self: _T) -> typing.Sequence[_T]:
Any unrecognised bits will be omitted for brevity.
The result will be a name-sorted `typing.Sequence` of each membe
The result will be a name-sorted `typing.Sequence` of each member
"""
return sorted(
(member for member in self.__class__._powers_of_2_to_member_map_.values() if member.value & self),
Expand Down
6 changes: 3 additions & 3 deletions hikari/internal/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ def utc_datetime() -> datetime.datetime:

# time.monotonic_ns is no slower than time.monotonic, but is more accurate.
# Also, fun fact that monotonic_ns appears to be 1µs faster on average than
# monotonic on AARM64 architectures, but on x86, monotonic is around 1ns faster
# monotonic on ARM64 architectures, but on x86, monotonic is around 1ns faster
# than monotonic_ns. Just thought that was kind of interesting to note down.
# (RPi 3B versus i7 6700)

# time.perf_counter and time.perf_counter_ns dont have proper typehints, causing
# pdoc to not be able to recognice them. This is just a little hack around that.
# time.perf_counter and time.perf_counter_ns don't have proper typehints, causing
# pdoc to not be able to recognise them. This is just a little hack around that.
def monotonic() -> float:
"""Performance counter for benchmarking.""" # noqa: D401 - Imperative mood
return time.perf_counter()
Expand Down
6 changes: 3 additions & 3 deletions hikari/presences.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def large_image_url(self) -> typing.Optional[files.URL]:
!!! note
This will be `builtins.None` if no large image asset exists or if the
asset's dymamic URL (indicated by a `{name}:` prefix) is not known.
asset's dynamic URL (indicated by a `{name}:` prefix) is not known.
"""
try:
return self.make_large_image_url()
Expand Down Expand Up @@ -215,7 +215,7 @@ def small_image_url(self) -> typing.Optional[files.URL]:
!!! note
This will be `builtins.None` if no large image asset exists or if the
asset's dymamic URL (indicated by a `{name}:` prefix) is not known.
asset's dynamic URL (indicated by a `{name}:` prefix) is not known.
"""
try:
return self.make_small_image_url()
Expand Down Expand Up @@ -295,7 +295,7 @@ class ActivityFlag(enums.Flag):
"""Party privacy: friends only."""

PARTY_PRIVACY_VOICE_CHANNEL = 1 << 7
"""Party prvacy: voice channel only."""
"""Party privacy: voice channel only."""

EMBEDDED = 1 << 8
"""An activity that's embedded into a voice channel."""
Expand Down
4 changes: 2 additions & 2 deletions hikari/snowflakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def calculate_shard_id(
The valid types for this type hint are:
- `buitlins.int`
- `builtins.int`
- `Snowflake`
"""

Expand All @@ -235,7 +235,7 @@ def calculate_shard_id(
The valid types for this type hint are:
- `buitlins.int`
- `builtins.int`
- `Snowflake`
- `datetime.datetime`
"""
Expand Down
12 changes: 6 additions & 6 deletions tests/hikari/impl/test_buckets.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ async def test_acquire_route_when_not_in_routes_to_real_hashes_makes_new_bucket_
async def test_acquire_route_when_not_in_routes_to_real_hashes_doesnt_cache_route(self):
with buckets.RESTBucketManager(max_rate_limit=float("inf")) as mgr:
route = mock.Mock()
route.create_real_bucket_hash = mock.Mock(wraps=lambda intial_hash: intial_hash + ";bobs")
route.create_real_bucket_hash = mock.Mock(wraps=lambda initial_hash: initial_hash + ";bobs")

mgr.acquire(route)

Expand All @@ -296,7 +296,7 @@ async def test_acquire_route_returns_context_manager(self):

bucket = mock.Mock(reset_at=time.perf_counter() + 999999999999999999999999999)
with mock.patch.object(buckets, "RESTBucket", return_value=bucket):
route.create_real_bucket_hash = mock.Mock(wraps=lambda intial_hash: intial_hash + ";bobs")
route.create_real_bucket_hash = mock.Mock(wraps=lambda initial_hash: initial_hash + ";bobs")

assert mgr.acquire(route) is bucket

Expand All @@ -315,7 +315,7 @@ async def test_acquire_unknown_route_returns_context_manager_for_new_bucket(self
async def test_update_rate_limits_if_wrong_bucket_hash_reroutes_route(self):
with buckets.RESTBucketManager(max_rate_limit=float("inf")) as mgr:
route = mock.Mock()
route.create_real_bucket_hash = mock.Mock(wraps=lambda intial_hash: intial_hash + ";bobs")
route.create_real_bucket_hash = mock.Mock(wraps=lambda initial_hash: initial_hash + ";bobs")
mgr.routes_to_hashes[route.route] = "123"

with mock.patch.object(hikari_date, "monotonic", return_value=27):
Expand All @@ -330,7 +330,7 @@ async def test_update_rate_limits_if_wrong_bucket_hash_reroutes_route(self):
async def test_update_rate_limits_if_unknown_bucket_hash_reroutes_route(self):
with buckets.RESTBucketManager(max_rate_limit=float("inf")) as mgr:
route = mock.Mock()
route.create_real_bucket_hash = mock.Mock(wraps=lambda intial_hash: intial_hash + ";bobs")
route.create_real_bucket_hash = mock.Mock(wraps=lambda initial_hash: initial_hash + ";bobs")
mgr.routes_to_hashes[route.route] = "123"
bucket = mock.Mock()
mgr.real_hashes_to_buckets["UNKNOWN;bobs"] = bucket
Expand All @@ -349,7 +349,7 @@ async def test_update_rate_limits_if_unknown_bucket_hash_reroutes_route(self):
async def test_update_rate_limits_if_right_bucket_hash_does_nothing_to_hash(self):
with buckets.RESTBucketManager(max_rate_limit=float("inf")) as mgr:
route = mock.Mock()
route.create_real_bucket_hash = mock.Mock(wraps=lambda intial_hash: intial_hash + ";bobs")
route.create_real_bucket_hash = mock.Mock(wraps=lambda initial_hash: initial_hash + ";bobs")
mgr.routes_to_hashes[route.route] = "123"
bucket = mock.Mock(reset_at=time.perf_counter() + 999999999999999999999999999)
mgr.real_hashes_to_buckets["123;bobs"] = bucket
Expand All @@ -365,7 +365,7 @@ async def test_update_rate_limits_if_right_bucket_hash_does_nothing_to_hash(self
async def test_update_rate_limits_updates_params(self):
with buckets.RESTBucketManager(max_rate_limit=float("inf")) as mgr:
route = mock.Mock()
route.create_real_bucket_hash = mock.Mock(wraps=lambda intial_hash: intial_hash + ";bobs")
route.create_real_bucket_hash = mock.Mock(wraps=lambda initial_hash: initial_hash + ";bobs")
mgr.routes_to_hashes[route.route] = "123"
bucket = mock.Mock(reset_at=time.perf_counter() + 999999999999999999999999999)
mgr.real_hashes_to_buckets["123;bobs"] = bucket
Expand Down
2 changes: 1 addition & 1 deletion tests/hikari/test_guilds.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def test_communication_disabled_until_when_raw_communication_disabled_until_is_N
with mock.patch.object(time, "utc_datetime", return_value=datetime.datetime(2021, 10, 18)):
assert model.communication_disabled_until() is None

def test_comminucation_disabled_until_when_raw_communication_disabled_until_is_in_the_past(self, model):
def test_communication_disabled_until_when_raw_communication_disabled_until_is_in_the_past(self, model):
model.raw_communication_disabled_until = datetime.datetime(2021, 10, 18)

with mock.patch.object(time, "utc_datetime", return_value=datetime.datetime(2021, 11, 22)):
Expand Down

3 comments on commit 4936222

@GoogolGenius
Copy link
Contributor

@GoogolGenius GoogolGenius commented on 4936222 May 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly can't believe this mess happened lol

Please see 4936222#commitcomment-73615647

@parafoxia
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remind me to triple-check all your spelling when you write your next 100k line project.

@GoogolGenius
Copy link
Contributor

@GoogolGenius GoogolGenius commented on 4936222 May 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there, I just wanted to post my response to someone that brought up an issue about the comment I sent here the other day:

First of all, thank you for bringing this up. Of course, I apologize to Hikari’s maintainers and contributors. I hadn’t thought about that before. I didn’t write that comment to cause any negative intentions. I haven’t had much experience myself with developing such a large open source project as a whole and didn’t consider the amount of effort that really goes into a project like this. I also didn’t consider that Hikari is a large codebase and with that, obviously then, it would be perfectly acceptable to have made these minor mistakes. We all make errors, of course. My intention initially was not to introduce any form of toxicity upon the community and it was my reaction to the commit that was inappropriate. Merely, my comment was meant to be lighthearted and not a real criticism of the people behind Hikari. I should have thought more: about my message, how it could be seen from other people’s eyes, the Hikari project itself, as well even other projects as a whole before commenting if any, an appropriate response. Again, I am truly sorry for the way this comment was interpreted and I would like to say to the maintainers that I meant you no toxic criticism in any way. I hope you can forgive me for my foolishness, and if not, I have still learned from this lesson.

Really, I apologize to Hikari’s maintainers and contributors for my inappropriate message here. I appreciate all the work you and contributors in the community has done and all I can do is to learn from my mistake as a human and ask for forgiveness.

Please sign in to comment.