Skip to content

Commit fe3ae0d

Browse files
committed
chore: Add typos spell check and fix spelling errors
1 parent 6833540 commit fe3ae0d

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

.github/workflows/_check_code.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,12 @@ jobs:
2828
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
2929
with:
3030
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
31+
32+
spell_check:
33+
name: Spell check
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v6
38+
- name: Check spelling with typos
39+
uses: crate-ci/[email protected]

src/crawlee/crawlers/_basic/_basic_crawler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
from crawlee.storages import Dataset, KeyValueStore, RequestQueue
7070

7171
from ._context_pipeline import ContextPipeline
72-
from ._context_utils import swaped_context
72+
from ._context_utils import swapped_context
7373
from ._logging_utils import (
7474
get_one_line_error_summary_if_possible,
7575
reduce_asyncio_timeout_error_to_relevant_traceback_parts,
@@ -536,7 +536,7 @@ def _wrap_handler_with_error_context(
536536

537537
@functools.wraps(handler)
538538
async def wrapped_handler(context: TCrawlingContext | BasicCrawlingContext, exception: Exception) -> T:
539-
# Original context helpers that are from `RequestHandlerRunResult` will not be commited as the request
539+
# Original context helpers that are from `RequestHandlerRunResult` will not be committed as the request
540540
# failed. Modified context provides context helpers with direct access to the storages.
541541
error_context = context.create_modified_copy(
542542
push_data=self._push_data,
@@ -1415,7 +1415,7 @@ async def __run_task_function(self) -> None:
14151415
request.state = RequestState.REQUEST_HANDLER
14161416

14171417
try:
1418-
with swaped_context(context, request):
1418+
with swapped_context(context, request):
14191419
self._check_request_collision(request, session)
14201420
await self._run_request_handler(context=context)
14211421
except asyncio.TimeoutError as e:

src/crawlee/crawlers/_basic/_context_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
@contextmanager
15-
def swaped_context(
15+
def swapped_context(
1616
context: BasicCrawlingContext,
1717
request: Request,
1818
) -> Iterator[None]:

typos.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Configuration for typos spell checker
2+
# https://github.com/crate-ci/typos
3+
4+
[default]
5+
extend-ignore-re = [
6+
"https?://[^\\s]+", # Ignore URLs
7+
]
8+
9+
[files]
10+
# Extend the default exclude list
11+
extend-exclude = [
12+
"*.lock",
13+
"*.min.js",
14+
"*.min.css",
15+
"CHANGELOG.md",
16+
]
17+
18+
[default.extend-identifiers]
19+
# Add project-specific identifiers that should not be treated as typos
20+
ser_json_inf_nan = "ser_json_inf_nan" # Pydantic config parameter
21+
asend = "asend" # Python async generator method
22+
23+
[default.extend-words]
24+
# Add project-specific words that should not be treated as typos
25+
mke = "mke" # Sennheiser MKE product name

0 commit comments

Comments
 (0)