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
19 changes: 6 additions & 13 deletions .github/workflows/american-spelling.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: American spelling

# Org-wide check, required through the org ruleset: fails a PR whose repo contains British
# spellings (colour, centre, cancelled, analyse...). The checker lives in this repo, so every
# repo gets the same version; each repo can allow words or skip paths in .american-spelling-allow.
# spellings (e.g. 'colour' for 'color'). Uses the public spelling-dialect action, so # spelling: ok
# every repo runs the same released version. A repo can allow words (stored values, external API
# names) or skip paths in .spelling-dialect (or the older .american-spelling-allow).
on:
pull_request:
merge_group:
Expand All @@ -15,15 +16,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out the repo being checked
uses: actions/checkout@v7
- name: Check out the checker
uses: actions/checkout@v7
- uses: actions/checkout@v7
- uses: ericdahl-dev/spelling-dialect@v1
with:
repository: ericdahl-dev/.github
path: .american-spelling-checker
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Check spelling
run: python .american-spelling-checker/scripts/american_spelling.py .
dialect: american
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
<!-- spelling: skip-file (this README quotes British spellings as examples) -->
# ericdahl-dev/.github

Organization-wide GitHub configuration.

## American spelling check

Every repo uses American spelling (color, center, canceled, analyze, gray...). The
**American spelling** workflow (`.github/workflows/american-spelling.yml`) runs
`scripts/american_spelling.py` on pull requests. The org ruleset requires it, so a PR can't
merge while its repo contains British spellings.
Every repo uses American spelling (color, center, canceled, analyze, gray...). The **American
spelling** workflow (`.github/workflows/american-spelling.yml`) runs the public
[spelling-dialect](https://github.com/ericdahl-dev/spelling-dialect) action on pull requests. The
org ruleset requires it, so a PR can't merge while its repo contains British spellings.

The checker reads every tracked text file word by word, including inside identifiers
(`colour_edges`, `AudioAnalyser`, `scanCancelled`), and prints `file:line: word -> fix`.
It reads every tracked text file word by word, including inside identifiers (`colour_edges`,
`AudioAnalyser`, `scanCancelled`), and prints `file:line: word -> fix`.

Run it locally on any repo:

```bash
python scripts/american_spelling.py path/to/repo
pipx run --spec git+https://github.com/ericdahl-dev/spelling-dialect spelling-dialect .
```

### Exceptions

- **One line:** add `spelling: ok` to the line (e.g. when quoting an external name).
- **One line:** add `spelling: ok` to it (e.g. when quoting an external name).
- **One file:** put `spelling: skip-file` in its first five lines.
- **A repo:** add `.american-spelling-allow` at its root:
- **A repo:** add `.spelling-dialect` at its root (the older `.american-spelling-allow` also works):

```
# a third-party API or a value stored in the database is spelled this way
cancelled
Colour
# vendored code
path: lib/unity/
```

Allowed words match case-insensitively, also inside identifiers. Use them for names you
don't control: stored data values, external API fields, vendored code. Web API names that are
British by definition (`AnalyserNode`, `createAnalyser`) are always allowed.
Allowed words match case-insensitively, also inside identifiers. Use them for names you don't
control: stored data values, external API fields, vendored code. Platform names that are British
by definition (`AnalyserNode`, `CancelledError`, `isCancelled`, GitHub Actions' `cancelled`) are
always allowed. See the [spelling-dialect README](https://github.com/ericdahl-dev/spelling-dialect#readme).
145 changes: 0 additions & 145 deletions scripts/american_spelling.py

This file was deleted.

Loading