Skip to content

Commit 86faab9

Browse files
authored
chore: Add typos spell check and fix spelling errors (#1628)
### Description - Add typos spell check - Fix spelling errors ### Issues - Closes: #626 ### Testing - N/A ### Checklist - [x] CI passed
1 parent 6833540 commit 86faab9

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

.github/workflows/_check_code.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ jobs:
1717
- name: Run actionlint
1818
uses: rhysd/[email protected]
1919

20+
spell_check:
21+
name: Spell check
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v6
26+
- name: Check spelling with typos
27+
uses: crate-ci/[email protected]
28+
2029
lint_check:
2130
name: Lint check
2231
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main

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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
"'gASV[^']+", # Ignore base64-encoded pickle data
8+
]
9+
10+
[files]
11+
# Extend the default exclude list
12+
extend-exclude = [
13+
"*.lock",
14+
"*.min.js",
15+
"*.min.css",
16+
"CHANGELOG.md",
17+
]
18+
19+
[default.extend-identifiers]
20+
# Add project-specific identifiers that should not be treated as typos
21+
ser_json_inf_nan = "ser_json_inf_nan" # Pydantic config parameter
22+
asend = "asend" # Python async generator method
23+
24+
[default.extend-words]
25+
# Add project-specific words that should not be treated as typos
26+
mke = "mke" # Sennheiser MKE product name

0 commit comments

Comments
 (0)