From 8292a1ebd2f52a098b7bf7d5df8fff7f02eb2e34 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Sun, 6 Apr 2025 00:26:01 +0800 Subject: [PATCH] :books: Fix typos Found via `codespell -L wee` and `typos --hidden --format brief` --- CONTRIBUTING.md | 2 +- src/braindrop/app/data/local.py | 6 +++--- src/braindrop/app/widgets/navigation.py | 2 +- src/braindrop/app/widgets/raindrops_view.py | 2 +- tests/unit/test_tags.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b72d1e9..6b014c8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ like something that makes sense for Braindrop I'll turn it into an issue from there. Be sure to [have a look over the TODO -isues](https://github.com/davep/braindrop/issues?q=is%3Aissue+is%3Aopen+label%3ATODO) +issues](https://github.com/davep/braindrop/issues?q=is%3Aissue+is%3Aopen+label%3ATODO) before leaving a request, it might be I'm already planning on implementing whatever it is you're asking for. diff --git a/src/braindrop/app/data/local.py b/src/braindrop/app/data/local.py index b56bac4..d404b81 100644 --- a/src/braindrop/app/data/local.py +++ b/src/braindrop/app/data/local.py @@ -179,7 +179,7 @@ def collection_size(self, collection: Collection) -> int: # can work it out). return collection.count or len(self.in_collection(collection)) - class UnknonwCollection(Exception): + class UnknownCollection(Exception): """Exception raised if we encounter a collection ID we don't know about.""" def collection(self, identity: int) -> Collection: @@ -201,7 +201,7 @@ def collection(self, identity: int) -> Collection: else self._collections[identity] ) except KeyError: - raise self.UnknonwCollection( + raise self.UnknownCollection( f"Unknown collection identity: {identity}" ) from None @@ -241,7 +241,7 @@ def _collections(collection_ids: Iterable[int]) -> Iterator[Collection]: for candidate in self.collections if candidate.parent == collection ) - except self.UnknonwCollection: + except self.UnknownCollection: pass return list(_collections(group.collections)) diff --git a/src/braindrop/app/widgets/navigation.py b/src/braindrop/app/widgets/navigation.py index 42cab04..c521516 100644 --- a/src/braindrop/app/widgets/navigation.py +++ b/src/braindrop/app/widgets/navigation.py @@ -342,7 +342,7 @@ def _main_navigation(self) -> None: self._add_children_for( self._add_collection(self.data.collection(collection)) ) - except self.data.UnknonwCollection: + except self.data.UnknownCollection: # It seems that the Raindrop API can sometimes say # there's a collection ID in a group where the # collection ID isn't in the actual collections the diff --git a/src/braindrop/app/widgets/raindrops_view.py b/src/braindrop/app/widgets/raindrops_view.py index 7d1b3db..c508208 100644 --- a/src/braindrop/app/widgets/raindrops_view.py +++ b/src/braindrop/app/widgets/raindrops_view.py @@ -126,7 +126,7 @@ class RaindropsView(EnhancedOptionList): ## The Raindrop collection view This panel shows the currently-selected collection of Raindrops, - filtered by any tag ans search text you may have applied. + filtered by any tag and search text you may have applied. Each Raindrop may have one or more icons showing to the right, these include: diff --git a/tests/unit/test_tags.py b/tests/unit/test_tags.py index 8fb57ef..0f47266 100644 --- a/tests/unit/test_tags.py +++ b/tests/unit/test_tags.py @@ -62,7 +62,7 @@ def test_sort_tags() -> None: ############################################################################## @mark.parametrize("string", ("", "1")) -def test_tag_langth(string: str) -> None: +def test_tag_length(string: str) -> None: """We should be able to get the len of a tag.""" assert len(Tag(string)) == len(string)