From 76800b049a705b02f104089ba70d13b0667a4046 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Wed, 8 Jan 2025 01:23:54 -0600 Subject: [PATCH] ci: check for typos in documentation (#16235) --- .github/workflows/typos.yml | 19 +++++++++++++++++++ .typos.toml | 2 ++ CONTRIBUTING.md | 2 +- docs/api/s3.md | 2 +- docs/api/sqlite.md | 4 ++-- docs/api/utils.md | 2 +- docs/cli/filter.md | 2 +- docs/install/lockfile.md | 2 +- docs/runtime/shell.md | 2 +- 9 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/typos.yml create mode 100644 .typos.toml diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 00000000000000..74c2aaec89a2c6 --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,19 @@ +name: Typos + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Spellcheck + uses: crate-ci/typos@v1.29.4 + with: + files: docs/**/* diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000000000..7819bc056fe4a8 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,2 @@ +[type.md] +extend-ignore-words-re = ["^ba"] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25e8fbdcc24dc8..03a2b4d663fc78 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -161,7 +161,7 @@ The binary will be located at `./build/release/bun` and `./build/release/bun-pro ### Download release build from pull requests -To save you time spent building a release build locally, we provide a way to run release builds from pull requests. This is useful for manully testing changes in a release build before they are merged. +To save you time spent building a release build locally, we provide a way to run release builds from pull requests. This is useful for manually testing changes in a release build before they are merged. To run a release build from a pull request, you can use the `bun-pr` npm package: diff --git a/docs/api/s3.md b/docs/api/s3.md index 46484e7e552539..f467cd21723a8d 100644 --- a/docs/api/s3.md +++ b/docs/api/s3.md @@ -367,7 +367,7 @@ If the `S3_*` environment variable is not set, Bun will also check for the `AWS_ These environment variables are read from [`.env` files](/docs/runtime/env) or from the process environment at initialization time (`process.env` is not used for this). -These defaults are overriden by the options you pass to `s3(credentials)`, `new Bun.S3Client(credentials)`, or any of the methods that accept credentials. So if, for example, you use the same credentials for different buckets, you can set the credentials once in your `.env` file and then pass `bucket: "my-bucket"` to the `s3()` helper function without having to specify all the credentials again. +These defaults are overridden by the options you pass to `s3(credentials)`, `new Bun.S3Client(credentials)`, or any of the methods that accept credentials. So if, for example, you use the same credentials for different buckets, you can set the credentials once in your `.env` file and then pass `bucket: "my-bucket"` to the `s3()` helper function without having to specify all the credentials again. ### `S3Client` objects diff --git a/docs/api/sqlite.md b/docs/api/sqlite.md index 49c84136bb6de9..f9a707d27c30da 100644 --- a/docs/api/sqlite.md +++ b/docs/api/sqlite.md @@ -82,7 +82,7 @@ const strict = new Database( // throws error because of the typo: const query = strict .query("SELECT $message;") - .all({ messag: "Hello world" }); + .all({ message: "Hello world" }); const notStrict = new Database( ":memory:" @@ -90,7 +90,7 @@ const notStrict = new Database( // does not throw error: notStrict .query("SELECT $message;") - .all({ messag: "Hello world" }); + .all({ message: "Hello world" }); ``` ### Load via ES module import diff --git a/docs/api/utils.md b/docs/api/utils.md index 8c96472f01be70..979e4068511d4b 100644 --- a/docs/api/utils.md +++ b/docs/api/utils.md @@ -121,7 +121,7 @@ const id = randomUUIDv7(); A UUID v7 is a 128-bit value that encodes the current timestamp, a random value, and a counter. The timestamp is encoded using the lowest 48 bits, and the random value and counter are encoded using the remaining bits. -The `timestamp` parameter defaults to the current time in milliseconds. When the timestamp changes, the counter is reset to a psuedo-random integer wrapped to 4096. This counter is atomic and threadsafe, meaning that using `Bun.randomUUIDv7()` in many Workers within the same process running at the same timestamp will not have colliding counter values. +The `timestamp` parameter defaults to the current time in milliseconds. When the timestamp changes, the counter is reset to a pseudo-random integer wrapped to 4096. This counter is atomic and threadsafe, meaning that using `Bun.randomUUIDv7()` in many Workers within the same process running at the same timestamp will not have colliding counter values. The final 8 bytes of the UUID are a cryptographically secure random value. It uses the same random number generator used by `crypto.randomUUID()` (which comes from BoringSSL, which in turn comes from the platform-specific system random number generator usually provided by the underlying hardware). diff --git a/docs/cli/filter.md b/docs/cli/filter.md index 38a497548b5ab3..62c53658a3da1f 100644 --- a/docs/cli/filter.md +++ b/docs/cli/filter.md @@ -41,7 +41,7 @@ $ bun outdated --filter 'pkg-*' $ bun outdated --filter './' ``` -For more infomation on both these commands, see [`bun install`](https://bun.sh/docs/cli/install) and [`bun outdated`](https://bun.sh/docs/cli/outdated). +For more information on both these commands, see [`bun install`](https://bun.sh/docs/cli/install) and [`bun outdated`](https://bun.sh/docs/cli/outdated). ## Running scripts with `--filter` diff --git a/docs/install/lockfile.md b/docs/install/lockfile.md index 72e11c89442974..88b858bd5361f6 100644 --- a/docs/install/lockfile.md +++ b/docs/install/lockfile.md @@ -100,7 +100,7 @@ $ head -n3 bun.lock "workspaces": { ``` -Once `bun.lock` is generated, Bun will use it for all subsequent installs and updates through commands that read and modify the lockfile. If both lockfiles exist, `bun.lock` will be choosen over `bun.lockb`. +Once `bun.lock` is generated, Bun will use it for all subsequent installs and updates through commands that read and modify the lockfile. If both lockfiles exist, `bun.lock` will be chosen over `bun.lockb`. Bun v1.2.0 will switch the default lockfile format to `bun.lock`. diff --git a/docs/runtime/shell.md b/docs/runtime/shell.md index 4423746831636c..99983bc12f8e68 100644 --- a/docs/runtime/shell.md +++ b/docs/runtime/shell.md @@ -102,7 +102,7 @@ The default handling of non-zero exit codes can be configured by calling `.nothr import { $ } from "bun"; // shell promises will not throw, meaning you will have to // check for `exitCode` manually on every shell command. -$.nothrow(); // equivilent to $.throws(false) +$.nothrow(); // equivalent to $.throws(false) // default behavior, non-zero exit codes will throw an error $.throws(true);