Skip to content

Commit 4538b38

Browse files
authored
ci(openapi): Add spell-check CI step and fix existing typos (#2187)
- Configure `typos` spell checker to check the repository. - Add `typos.toml` config to ignore false positives. - Fix all current typos. - Relates: #2182
1 parent 7e4663f commit 4538b38

13 files changed

Lines changed: 74 additions & 18 deletions

File tree

.github/workflows/spell-check.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Spell check
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
spell_check:
11+
name: Spell check
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v6
16+
- name: Check spelling with typos
17+
uses: crate-ci/typos@v1.42.0

examples/ts-parallel-scraping/orchestrator/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if (state.isInitialized) {
3636
const runClient = apifyClient.run(runId);
3737
const run = await runClient.get();
3838

39-
// This should happen only if the run was deleted or the state was incorectly saved.
39+
// This should happen only if the run was deleted or the state was incorrectly saved.
4040
if (!run) throw await Actor.fail(`The run ${runId} from state does not exists.`);
4141

4242
if (run.status === 'RUNNING') {

sources/academy/platform/expert_scraping_with_apify/apify_api_and_client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The new Actor should take the following input values, which be mapped to paramet
4949
"useClient": false,
5050

5151
// The fields in each item to return back. All other
52-
// fields should be ommitted
52+
// fields should be omitted
5353
"fields": ["title", "itemUrl", "offer"],
5454

5555
// The maximum number of items to return back

sources/academy/tutorials/node_js/caching_responses_in_puppeteer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ page.on('response', async (response) => {
7777
try {
7878
buffer = await response.buffer();
7979
} catch (error) {
80-
// some responses do not contain buffer and do not need to be catched
80+
// some responses do not contain buffer and do not need to be caught
8181
return;
8282
}
8383

sources/academy/tutorials/node_js/filter_blocked_requests_using_sessions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ slug: /node-js/filter-blocked-requests-using-sessions
77

88
_This article explains how the problem was solved before the [SessionPool](/sdk/js/docs/api/session-pool) class was added into [Apify SDK](/sdk/js/). We are keeping the article here as it might be interesting for people who want to see how to work with sessions on a lower level. For any practical usage of sessions, follow the documentation and examples of SessionPool._
99

10-
### Overview of the problem
10+
## Overview of the problem
1111

1212
You want to crawl a website with a proxy pool, but most of your proxies are blocked. It's a very common situation. Proxies can be blocked for many reasons:
1313

@@ -25,7 +25,7 @@ Nobody can make sure that a proxy will work infinitely. The only real solution t
2525

2626
However, usually, at least some of our proxies work. To crawl successfully, it is therefore imperative to handle blocked requests properly. You first need to discover that you are blocked, which usually means that either your request returned status greater or equal to 400 (it didn't return the proper response) or that the page displayed a captcha. To ensure that this bad request is retried, you usually throw an error and it gets automatically retried later (our [SDK](/sdk/js/) handles this for you). Check out [this article](https://docs.apify.com/academy/node-js/handle-blocked-requests-puppeteer) as inspiration for how to handle this situation with `PuppeteerCrawler` class.
2727

28-
### Solution
28+
## Solution
2929

3030
Now we are able to retry bad requests and eventually unless all of our proxies get banned, we should be able to successfully crawl what we want. The problem is that it takes too long and our log is full of errors. Fortunately, we can overcome this with [proxy sessions](/platform/proxy/datacenter-proxy#username-parameters) (look at the proxy and SDK documentation for how to use them in your Actors.)
3131

@@ -50,7 +50,7 @@ Apify.main(async () => {
5050
});
5151
```
5252

53-
### Algorithm
53+
## Algorithm
5454

5555
You don't necessarily need to understand the solution below - it should be fine to copy/paste it to your Actor.
5656

@@ -121,7 +121,7 @@ const pickSession = (sessions, maxSessions = 100) => {
121121
};
122122
```
123123

124-
### Puppeteer example
124+
## Puppeteer example
125125

126126
We then use this function whenever we want to get the session for our request. Here is an example of how we would use it for bare bones Puppeteer (for example as a part of `BasicCrawler` class).
127127

@@ -142,11 +142,11 @@ After success:
142142
After failure (captcha, blocked request, etc.):
143143
`delete sessions[session.name]`
144144

145-
### PuppeteerCrawler example
145+
## PuppeteerCrawler example
146146

147147
Now you might start to wonder, "I have already prepared an Actor using PuppeteerCrawler, can I make it work there?". The problem is that with PuppeteerCrawler we don't have everything nicely inside one function scope like when using pure Puppeteer or BasicCrawler. Fortunately, there is a little hack that enables passing the session name to where we need it.
148148

149-
First we define `lauchPuppeteerFunction` which tells the crawler how to create new browser instances and we pass the picked session there.
149+
First we define `launchPuppeteerFunction` which tells the crawler how to create new browser instances and we pass the picked session there.
150150

151151
```js
152152
const crawler = new Apify.PuppeteerCrawler({

sources/academy/tutorials/node_js/multiple-runs-scrape.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ if (state.isInitialized) {
114114
const runClient = apifyClient.run(runId);
115115
const run = await runClient.get();
116116
117-
// This should happen if the run was deleted or the state was incorectly saved.
117+
// This should happen if the run was deleted or the state was incorrectly saved.
118118
if (!run) throw new Error(`The run ${runId} from state does not exists.`);
119119
120120
if (run.status === 'RUNNING') {

sources/academy/webscraping/scraping_basics_javascript/08_saving_data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ $ node index.js
112112

113113
## Saving data as JSON
114114

115-
The JSON format is popular primarily among developers. We use it for storing data, configuration files, or as a way to transfer data between programs (e.g., APIs). Its origin stems from the syntax of JavaScript objects, but people now use it accross programming languages.
115+
The JSON format is popular primarily among developers. We use it for storing data, configuration files, or as a way to transfer data between programs (e.g., APIs). Its origin stems from the syntax of JavaScript objects, but people now use it across programming languages.
116116

117117
We'll begin with importing the `writeFile` function from the Node.js standard library, so that we can, well, write files:
118118

sources/legal/latest/terms/store-publishing-terms-and-conditions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ We are authorized to unpublish and/or delete such an Actor, in our sole discreti
8585

8686
1. "**Monthly Rental**" which means that each User of your Actor will pay a flat monthly rental fee for use of that Actor. You will set the price as X USD per month;
8787
2. "**Pay per Result**" which means that each User of your Actor will pay a fee calculated according to the number of results of each run of that Actor. You will set the price as X USD per 1,000 results. In this model, the Users do not pay for the Platform usage; or
88-
3. "**Pay per Event**" which allows you to programatically charge for events in your Actor source code. You need to pre-define the events first when setting the Actor pricing and configure whether Users pay for the Platform usage or not.
88+
3. "**Pay per Event**" which allows you to programmatically charge for events in your Actor source code. You need to pre-define the events first when setting the Actor pricing and configure whether Users pay for the Platform usage or not.
8989

9090
11.2. If you set your Actor as monetized, you will be entitled to receive remuneration calculated as follows:
9191

sources/platform/integrations/ai/langchain.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ After running the code, you should see the following output:
128128

129129
```text
130130
answer: LangChain is a framework designed for developing applications powered by large language models (LLMs). It simplifies the
131-
entire application lifecycle, from development to productionization and deployment. LangChain provides open-source components a
132-
nd integrates with various third-party tools, making it easier to build and optimize applications using language models.
131+
entire application lifecycle, from development to productionization and deployment. LangChain provides open-source components and integrates with various third-party tools, making it easier to build and optimize applications using language models.
133132
134133
source: https://python.langchain.com/docs/get_started/introduction
135134
```

sources/platform/integrations/data-storage/airtable/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ Go to [Airtable](https://airtable.com) and open the base you would like to work
3939
![Access the extensions tab on Airtable UI by pressing tools button](../../images/airtable/airtable_tools_button.png)
4040

4141
<!-- TODO: improve pictures when Apify integration is published -->
42-
Search for Apify extenison and install it
42+
Search for Apify extension and install it
4343

44-
![Search for the Apify extension on Airtable](../../images/airtable/airtable_search_apify_extenison.png)
44+
![Search for the Apify extension on Airtable](../../images/airtable/airtable_search_apify_extension.png)
4545

4646
Open the Apify extension and login using OAuth 2.0 with your Apify account. If you dont have an account, visit [Apify registration](https://console.apify.com/sign-up) page.
4747

0 commit comments

Comments
 (0)