Skip to content

Commit

Permalink
ci: check for typos in documentation (#16235)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac authored Jan 8, 2025
1 parent 81ecf75 commit 76800b0
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 8 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
files: docs/**/*
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[type.md]
extend-ignore-words-re = ["^ba"]
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion docs/api/s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/api/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ 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:"
);
// does not throw error:
notStrict
.query("SELECT $message;")
.all({ messag: "Hello world" });
.all({ message: "Hello world" });
```

### Load via ES module import
Expand Down
2 changes: 1 addition & 1 deletion docs/api/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion docs/cli/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 1 addition & 1 deletion docs/install/lockfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion docs/runtime/shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 76800b0

Please sign in to comment.