diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 41eb5e2..3a7db73 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -37,7 +37,7 @@ jobs:
# six-hour default before anyone hears about it. That is not hypothetical —
# a test that blocked on `accept()` with no deadline wedged the Windows leg
# for its full six hours, and the only reason it went unnoticed for a day
- # is that every run on `main` was cancelled by the next push first.
+ # is that every run on `main` was canceled by the next push first.
#
# On all three rather than Windows alone: nobody here runs Windows as a
# daily driver, so CI is the only signal it has — but a Unix leg that
@@ -307,7 +307,7 @@ jobs:
"https://github.com/rustsec/rustsec/releases/download/cargo-audit%2Fv${AUDIT_VERSION}/${name}.tgz"
echo "${AUDIT_SHA256} /tmp/cargo-audit.tgz" | sha256sum -c -
# The archive has a versioned top-level directory and carries a
- # README and two licences beside the binary; name the one file that
+ # README and two licenses beside the binary; name the one file that
# belongs on PATH.
tar xzf /tmp/cargo-audit.tgz -C "$HOME/.cargo/bin" \
--strip-components=1 "${name}/cargo-audit"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4bcbbd7..5a73aac 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -124,7 +124,7 @@ that may never merge. They are not releases and are not listed here.
`unsupported scheme socks5` in the message is the part that distinguishes
it from the network being down.
-- `rand` moved from 0.8 to 0.10. No behaviour changes: the two places it is
+- `rand` moved from 0.8 to 0.10. No behavior changes: the two places it is
used — the PKCE verifier and the OAuth `state` in `mapbox auth login` —
draw from `ThreadRng` before and after, which `rand` declares a CSPRNG, and
`thread_rng().gen()` becoming `random()` is a rename. Recorded because it
@@ -132,7 +132,7 @@ that may never merge. They are not releases and are not listed here.
this release should be able to find it. Both are now covered by tests
against RFC 7636, which they were not before.
-- Both installers now honour `MAPBOX_CLI_NO_TELEMETRY`, the name the binary
+- Both installers now honor `MAPBOX_CLI_NO_TELEMETRY`, the name the binary
reads. They were left on the old `DISABLE_TELEMETRY` when the binary was
renamed, so neither name silenced both halves: the documented variable
stopped the CLI's markers but not the installer's, and the old one did the
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 46d2166..49d7b78 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -41,9 +41,19 @@ logged in.
Four rules the compiler holds rather than a reviewer, declared in
`Cargo.toml` with the reasoning beside each: no `unsafe`, no `println!`
-(stdout belongs to `output::emit`, the single place `--output` is honoured),
+(stdout belongs to `output::emit`, the single place `--output` is honored),
no `dbg!`, no `todo!`/`unimplemented!`.
+Write American English: comments, documentation, commit messages, and every
+string the CLI prints. `prose_is_american_english` in
+`tests/source_guards.rs` reads the files and fails on the British spelling,
+so this is a test rather than something a reviewer has to notice, and the
+failure names the file and the line. It leaves two things alone on purpose.
+Fenced code blocks, because sample output and captured API responses are
+quoted rather than written, and rewriting a word inside one would make the
+document misquote its source. And the `cancelled` error code, which is a
+compatibility promise scripts may match on rather than a spelling.
+
## Where the commands come from
Commands are generated at build time from the OpenAPI specs in `openapi/`,
diff --git a/Cargo.toml b/Cargo.toml
index 7c54919..8cb4407 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,11 +5,11 @@ edition = "2021"
description = "A command-line interface for Mapbox APIs, with commands generated at build time from OpenAPI specs."
repository = "https://github.com/mapbox/cli"
# The file rather than an SPDX expression: LICENSE is Mapbox's own terms and
-# not an OSI licence, so there is no identifier that says what it grants.
+# not an OSI license, so there is no identifier that says what it grants.
license-file = "LICENSE"
# A rail against an accidental `cargo publish`, not a decision that it never
# could be reconsidered: crates.io is for crates anyone may use under an open
-# licence, and a publish cannot be taken back.
+# license, and a publish cannot be taken back.
publish = false
# The oldest Rust this crate compiles on, measured rather than aspirational:
# `CredentialLock` in src/auth.rs calls `File::lock`/`unlock`, stabilised in
@@ -46,7 +46,7 @@ unsafe_code = "deny"
[lints.clippy]
# The output contract, made mechanical. This repo's rule is: don't reintroduce a
# `println!` for a result — stdout belongs to `output::emit`, which is the
-# single place `--output` is honoured and the single place a result is
+# single place `--output` is honored and the single place a result is
# written. There are no violations today; this keeps it that way.
# `print_stderr` is deliberately *not* denied: warnings and progress go to
# stderr from a dozen places on purpose, several of them outside the output
diff --git a/docs/commands.md b/docs/commands.md
index cd536e2..525ed1b 100644
--- a/docs/commands.md
+++ b/docs/commands.md
@@ -1586,7 +1586,7 @@ mapbox sprites delete ckstyle00000000000000001a zz-clitest-1 --username user
The sprite index **after** the delete — the named icon is gone from it, and
everything else is still there. A 200 with the full layout, not a 204: the
-absence of the icon is the only acknowledgement there is.
+absence of the icon is the only acknowledgment there is.
Terminal — -o text
Agent — -o json
@@ -1723,7 +1723,7 @@ one, so a plain map image needs no overlay expression.
### `mapbox static get-image`
-A map image centred on a point.
+A map image centered on a point.
#### Parameters
@@ -2083,7 +2083,7 @@ mapbox styles delete ckstyle00000000000000003c --username user
A 204 carries no body. Rather than print nothing, the CLI confirms what
happened — nothing is asked beforehand, so the line after the fact is the
-only acknowledgement there is.
+only acknowledgment there is.
Terminal — -o text
Agent — -o json
@@ -2524,7 +2524,7 @@ security, style quality, geospatial operations and the mobile and web SDKs.
Twenty skills, each a directory of Markdown.
**Not the same as [`generate-skills`](#generate-skills)**, which is its
-neighbour in `--help` and writes something else entirely: that one renders a
+neighbor in `--help` and writes something else entirely: that one renders a
skill describing *this CLI's own commands*, from the specs compiled into the
binary. These are about using Mapbox; that one is about using `mapbox`. They
share the destination flags below and nothing else.
@@ -2834,7 +2834,7 @@ mapbox/mapbox-agent-skills@main.` and `"updated": []`.
### `mapbox agent-skills uninstall`
Removes installed skill directories. At least one `NAME` is required — an
-empty list is not a licence to remove everything.
+empty list is not a license to remove everything.
**This is the one subcommand that makes no request.** It works from what is on
disk, which also means it can remove a skill that has since been unpublished.
@@ -3476,7 +3476,7 @@ names the flag rather than offering a login that could not outrank it.
| `http_` | The API answered non-2xx. Carries `status` and the response `body`. |
| `request_failed` | Transport failure — proxy, DNS, TLS. Never carries the URL, because the access token rides in its query string. |
-The CLI honours `HTTPS_PROXY`, `HTTP_PROXY`, `ALL_PROXY` and `NO_PROXY`, and
+The CLI honors `HTTPS_PROXY`, `HTTP_PROXY`, `ALL_PROXY` and `NO_PROXY`, and
needs no proxy configuration of its own. Two things that look like network
faults and are not:
diff --git a/scripts/install.ps1 b/scripts/install.ps1
index 1ce4d57..cbd81b8 100644
--- a/scripts/install.ps1
+++ b/scripts/install.ps1
@@ -5,7 +5,7 @@
# irm https://cli.mapbox.com/install.ps1 | iex
#
# This is the Windows half of scripts/install.sh, which is POSIX sh and stops
-# with instructions when it recognises Git Bash, MSYS2 or Cygwin. The two are
+# with instructions when it recognizes Git Bash, MSYS2 or Cygwin. The two are
# the same script in two languages: same environment variables, same order of
# operations, and the same things said about a checksum that does not match, an
# install directory that cannot be written, and a `mapbox` that came from
@@ -86,7 +86,7 @@
# because this value comes from the environment and ends up in a header.
$InstallSource = $env:MAPBOX_CLI_INSTALL_SOURCE
- # The switch src/telemetry.rs honours for the CLI's own User-Agent, read
+ # The switch src/telemetry.rs honors for the CLI's own User-Agent, read
# here the same way, because someone who put it in a Dockerfile and then
# runs `irm ... | iex` in the same file has already said which way they
# want it. The product token above survives it - the equivalent of
@@ -95,7 +95,7 @@
#
# Two names, and only the binary dropped the old one.
# MAPBOX_CLI_NO_TELEMETRY is the documented switch; DISABLE_TELEMETRY is
- # what it was called before, and this script still honours it. The rename
+ # what it was called before, and this script still honors it. The rename
# was announced as breaking for the binary; nothing announced it for the
# installers, which are fetched and run in one line with no release notes
# in front of the reader - and breaking an opt-out is the one change that
diff --git a/scripts/install.sh b/scripts/install.sh
index 37002da..243d5b0 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -62,7 +62,7 @@ USER_AGENT='mapbox-cli-install/1'
# header.
INSTALL_SOURCE="${MAPBOX_CLI_INSTALL_SOURCE:-}"
-# The switch `src/telemetry.rs` honours for the CLI's own User-Agent, read here
+# The switch `src/telemetry.rs` honors for the CLI's own User-Agent, read here
# the same way, because someone who put it in a Dockerfile and then pipes this
# script into sh in the same file has already said which way they want it. The
# product token above is what survives it — the equivalent of
@@ -71,7 +71,7 @@ INSTALL_SOURCE="${MAPBOX_CLI_INSTALL_SOURCE:-}"
#
# **Two names, and only the binary dropped the old one.**
# `MAPBOX_CLI_NO_TELEMETRY` is the documented switch; `DISABLE_TELEMETRY` is
-# what it was called before, and this script still honours it. The rename was
+# what it was called before, and this script still honors it. The rename was
# announced as breaking for the binary, so a `DISABLE_TELEMETRY=1` there
# genuinely stopped working and the changelog says so. Nothing announced it for
# the installers — this file is fetched and run in one line, so a reader has no
@@ -625,7 +625,7 @@ install_tilesets() {
return 2
}
-# Honour MAPBOX_TILESETS_CLI, the override the CLI itself respects: someone
+# Honor MAPBOX_TILESETS_CLI, the override the CLI itself respects: someone
# who has pointed it at a particular executable has already made this
# decision, whether or not that executable is currently there.
if [ -n "${MAPBOX_TILESETS_CLI:-}" ]; then
diff --git a/scripts/test-install.ps1 b/scripts/test-install.ps1
index 210a254..1a04678 100644
--- a/scripts/test-install.ps1
+++ b/scripts/test-install.ps1
@@ -8,7 +8,7 @@
#
# ci.yml runs it under both, because that is the split install.ps1 has to cope
# with: 5.1 is what `powershell` opens on a stock Windows 11 and is where the
-# TLS default, the progress bar and the stderr-is-an-error behaviour bite.
+# TLS default, the progress bar and the stderr-is-an-error behavior bite.
#
# It also runs on macOS and Linux under pwsh, which is how it is developed -
# there is no Windows to hand. The cases that cannot mean anything there (the
@@ -486,7 +486,7 @@ try {
$tagged = @($logged | Where-Object { $_ -like '*src/onboardingscriptrm-rf' })
Expect-Equal '2' ([string]$logged.Count) 'made the two requests a run makes: the manifest and the archive'
Expect-Equal '2' ([string]$marked.Count) 'both name the installer and the triple'
- Expect-Equal '2' ([string]$tagged.Count) 'both carry the source tag, sanitised for a header'
+ Expect-Equal '2' ([string]$tagged.Count) 'both carry the source tag, sanitized for a header'
Clear-Env 'MAPBOX_CLI_INSTALL_SOURCE'
Start-Case 'DISABLE_TELEMETRY keeps it down to the product token'
@@ -514,10 +514,10 @@ try {
Clear-Env 'DISABLE_TELEMETRY'
Clear-Env 'MAPBOX_CLI_INSTALL_SOURCE'
- Start-Case 'MAPBOX_CLI_NO_TELEMETRY is honoured, and outranks the old name'
+ Start-Case 'MAPBOX_CLI_NO_TELEMETRY is honored, and outranks the old name'
New-CaseEnv 'telemetry-new-name'
$env:MAPBOX_CLI_INSTALL_SOURCE = 'dockerfile'
- # The documented name, which the binary reads and this script honours too.
+ # The documented name, which the binary reads and this script honors too.
$env:MAPBOX_CLI_NO_TELEMETRY = '1'
[IO.File]::WriteAllText($RequestLog, '')
Invoke-Installer
diff --git a/scripts/test-install.sh b/scripts/test-install.sh
index ca51105..37a6f84 100755
--- a/scripts/test-install.sh
+++ b/scripts/test-install.sh
@@ -198,7 +198,7 @@ expect_says() { # command-output want label
# and `sha256` has to choose between entries rather than match the only one
# there. One of the decoys is the Windows `.zip`, sitting immediately after
# the entry being read: extensions are no longer uniform across targets, and
-# the neighbour a greedy match would bleed into is the one that proves it does
+# the neighbor a greedy match would bleed into is the one that proves it does
# not.
make_channel() { # dir version [bad-sha|broken]
channel_dir="$1"
@@ -658,7 +658,7 @@ expect_in_file "$CURL_LOG" "-A ${INSTALLER_UA} (${TARGET}" 'DISABLE_TELEMETRY=0
expect_in_file "$CURL_LOG" ' src/dockerfile' 'and the tag comes back with it'
unset MAPBOX_TEST_CURL_LOG DISABLE_TELEMETRY MAPBOX_CLI_INSTALL_SOURCE
-start 'MAPBOX_CLI_NO_TELEMETRY is honoured, and outranks the old name'
+start 'MAPBOX_CLI_NO_TELEMETRY is honored, and outranks the old name'
new_case_env telemetry-new-name
export MAPBOX_INSTALL_TILESETS=no
export MAPBOX_CLI_INSTALL_SOURCE=dockerfile
@@ -666,7 +666,7 @@ shim curl-recording curl
CURL_LOG="${CASE_DIR}/curl-args"
export MAPBOX_TEST_CURL_LOG="$CURL_LOG"
-# The documented name, which the binary reads and this script honours too.
+# The documented name, which the binary reads and this script honors too.
: >"$CURL_LOG"
export MAPBOX_CLI_NO_TELEMETRY=1
run_piped && status=0 || status=$?
@@ -1026,7 +1026,7 @@ expect_no_out 'is not installed' 'says nothing else about it'
expect_no_out 'Install it as well?' 'does not ask'
expect_no_out 'fake pipx' 'installs nothing'
-start 'MAPBOX_TILESETS_CLI is honoured, set or broken'
+start 'MAPBOX_TILESETS_CLI is honored, set or broken'
new_case_env tilesets-override
shim pipx
mkdir -p "${CASE_DIR}/opt"
diff --git a/src/agent_skills.rs b/src/agent_skills.rs
index 259edd3..63b45a4 100644
--- a/src/agent_skills.rs
+++ b/src/agent_skills.rs
@@ -1,6 +1,6 @@
//! `mapbox agent-skills` — install the published Mapbox Agent Skills.
//!
-//! Not to be confused with its neighbour. [`crate::generate_skills`] writes a
+//! Not to be confused with its neighbor. [`crate::generate_skills`] writes a
//! skill describing *this CLI's own commands*, rendered from the specs
//! compiled into the binary. This command installs the *hand-written Mapbox
//! domain skills* — cartography, token security, iOS and Android patterns,
@@ -1210,7 +1210,7 @@ mod tests {
encoder.finish().expect("finish gzip")
}
- const SKILL_MD: &[u8] = b"---\nname: mapbox-cartography\ndescription: Map design, colour and type. Use when styling.\n---\n\n# Cartography\n";
+ const SKILL_MD: &[u8] = b"---\nname: mapbox-cartography\ndescription: Map design, color and type. Use when styling.\n---\n\n# Cartography\n";
fn one_skill() -> Vec {
archive(&[
@@ -1252,7 +1252,7 @@ mod tests {
assert_eq!(skill.name, "mapbox-cartography");
assert_eq!(
skill.description.as_deref(),
- Some("Map design, colour and type. Use when styling.")
+ Some("Map design, color and type. Use when styling.")
);
let paths: Vec = skill
diff --git a/src/auth.rs b/src/auth.rs
index fd577b7..2695298 100644
--- a/src/auth.rs
+++ b/src/auth.rs
@@ -947,7 +947,7 @@ impl Identity<'_> {
Some("pk") => "public (pk)",
Some("sk") => "secret (sk)",
Some("tk") => "temporary (tk)",
- _ => "unrecognised prefix",
+ _ => "unrecognized prefix",
};
match self.expires_at {
Some(exp) => format!("{usage}, expires {}", time_until(exp, now)),
@@ -1062,7 +1062,7 @@ fn rejected_token(
),
"TokenInvalid" => (
"token_invalid",
- "Mapbox does not recognise the token it would be given.".to_string(),
+ "Mapbox does not recognize the token it would be given.".to_string(),
),
"TokenExpired" => (
"token_expired",
@@ -1190,7 +1190,7 @@ fn profile_name(profile: Option<&str>) -> &str {
/// token in order to report that it would spend the refresh token is the
/// exact mutation the flag exists to avoid — and it takes no
/// [`CredentialLock`] either, since it writes nothing there is anything to
-/// serialise against.
+/// serialize against.
///
/// A precondition the real command would fail on is still a failure here:
/// `refresh` with nothing stored reports what `force_refresh` reports rather
@@ -2195,7 +2195,7 @@ mod tests {
assert_eq!(token_usage("pk.body.signature"), Some("pk"));
assert_eq!(token_usage("sk.body.signature"), Some("sk"));
assert_eq!(token_usage("tk.body.signature"), Some("tk"));
- // Anything else is reported as unrecognised rather than guessed at.
+ // Anything else is reported as unrecognized rather than guessed at.
assert_eq!(token_usage("xx.body.signature"), None);
assert_eq!(token_usage("pk."), None);
assert_eq!(token_usage("nodotsatall"), None);
@@ -2515,7 +2515,7 @@ mod tests {
);
assert!(
elapsed < Duration::from_secs(5),
- "waited {elapsed:?}, so the deadline is not being honoured"
+ "waited {elapsed:?}, so the deadline is not being honored"
);
}
diff --git a/src/completion.rs b/src/completion.rs
index f70076c..0a33158 100644
--- a/src/completion.rs
+++ b/src/completion.rs
@@ -114,7 +114,7 @@ pub fn warn_output_ignored(matches: &ArgMatches) {
return;
}
eprintln!(
- "Warning: `--{}` is not honoured by `{COMMAND}` — a completion script is a shell \
+ "Warning: `--{}` is not honored by `{COMMAND}` — a completion script is a shell \
script, and wrapping it in an envelope would leave it unsourceable.",
crate::output::ARG
);
@@ -155,7 +155,7 @@ pub fn run(app: &Command, matches: &ArgMatches) -> Result<()> {
// the result, and there is no rendering of it that is not itself.
let mut out = io::stdout().lock();
match out.write_all(&script).and_then(|()| out.flush()) {
- // A reader that stopped reading is `head`'s ordinary behaviour, not a
+ // A reader that stopped reading is `head`'s ordinary behavior, not a
// failure to report: the error envelope would be the only thing left
// on a terminal after a command that did exactly what was asked.
Err(e) if e.kind() == io::ErrorKind::BrokenPipe => Ok(()),
diff --git a/src/confirm.rs b/src/confirm.rs
index e0ad812..3edfb43 100644
--- a/src/confirm.rs
+++ b/src/confirm.rs
@@ -10,7 +10,7 @@
//! out unasked.
//!
//! `--yes` says the answer is yes before it is asked, which is the only way a
-//! caller *at* a terminal can get the non-interactive behaviour on purpose.
+//! caller *at* a terminal can get the non-interactive behavior on purpose.
//!
//! The question is deliberately not `--output`-aware. It goes to stderr as
//! prose in both modes, because the only way to see it is to be a person at a
diff --git a/src/executor.rs b/src/executor.rs
index 34ff195..309a6d2 100644
--- a/src/executor.rs
+++ b/src/executor.rs
@@ -1268,7 +1268,7 @@ fn is_binary_content_type(content_type: &str) -> bool {
///
/// Guessing from the content type rather than always saying `.png`: telling
/// someone to redirect a glyph range into `out.png` is advice that produces
-/// a mislabelled file, and it reads as though the command misunderstood what
+/// a mislabeled file, and it reads as though the command misunderstood what
/// it fetched.
fn suggested_extension(content_type: &str) -> &'static str {
let essence = content_type
@@ -1301,7 +1301,7 @@ fn suggested_extension(content_type: &str) -> &'static str {
}
/// Writes raw bytes to stdout, refusing to do so when that is a terminal —
-/// `curl`'s behaviour, and for the same reason: a few hundred KB of PNG will
+/// `curl`'s behavior, and for the same reason: a few hundred KB of PNG will
/// otherwise scramble the user's shell.
fn write_binary(body: &[u8], content_type: &str) -> Result<()> {
use std::io::{IsTerminal, Write};
diff --git a/src/generate_skills.rs b/src/generate_skills.rs
index 28eb90f..4936e0c 100644
--- a/src/generate_skills.rs
+++ b/src/generate_skills.rs
@@ -159,7 +159,7 @@ pub fn run(app: &Command, specs: &[ServiceSpec], matches: &ArgMatches, mode: Mod
/// The services to describe, or `None` for all of them.
///
-/// An unrecognised name is an error naming the alternatives rather than a
+/// An unrecognized name is an error naming the alternatives rather than a
/// silent no-op: `--service style` is a typo, and writing a skill that
/// describes nothing is a worse answer to it than refusing.
fn requested_services(schema: &Schema, matches: &ArgMatches) -> Result