Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/_check_code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ jobs:
- name: Run actionlint
uses: rhysd/[email protected]

spell_check:
name: Spell check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Check spelling with typos
uses: crate-ci/[email protected]

lint_check:
name: Lint check
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
Expand Down
6 changes: 3 additions & 3 deletions src/crawlee/crawlers/_basic/_basic_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
from crawlee.storages import Dataset, KeyValueStore, RequestQueue

from ._context_pipeline import ContextPipeline
from ._context_utils import swaped_context
from ._context_utils import swapped_context
from ._logging_utils import (
get_one_line_error_summary_if_possible,
reduce_asyncio_timeout_error_to_relevant_traceback_parts,
Expand Down Expand Up @@ -536,7 +536,7 @@ def _wrap_handler_with_error_context(

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

try:
with swaped_context(context, request):
with swapped_context(context, request):
self._check_request_collision(request, session)
await self._run_request_handler(context=context)
except asyncio.TimeoutError as e:
Expand Down
2 changes: 1 addition & 1 deletion src/crawlee/crawlers/_basic/_context_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@contextmanager
def swaped_context(
def swapped_context(
context: BasicCrawlingContext,
request: Request,
) -> Iterator[None]:
Expand Down
26 changes: 26 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Configuration for typos spell checker
# https://github.com/crate-ci/typos

[default]
extend-ignore-re = [
"https?://[^\\s]+", # Ignore URLs
"'gASV[^']+", # Ignore base64-encoded pickle data
]

[files]
# Extend the default exclude list
extend-exclude = [
"*.lock",
"*.min.js",
"*.min.css",
"CHANGELOG.md",
]

[default.extend-identifiers]
# Add project-specific identifiers that should not be treated as typos
ser_json_inf_nan = "ser_json_inf_nan" # Pydantic config parameter
asend = "asend" # Python async generator method

[default.extend-words]
# Add project-specific words that should not be treated as typos
mke = "mke" # Sennheiser MKE product name