Skip to content

Commit

Permalink
[spellcheck] Add integration with cspell (#12780)
Browse files Browse the repository at this point in the history
Recently we started getting a lot of PRs fixing spelling errors in our
documents. Relevant Zulip discussion
[link](https://near.zulipchat.com/#narrow/channel/308695-nearone.2Fprivate/topic/external.20PRs.20fixing.20spelling.20issues)

This PR integrates a util called **cspell** into the github actions
([cspell-action](https://github.com/streetsidesoftware/cspell-action))
to automatically catch spelling errors.

There's a cspell.json config added that has a list of allowed words. And
new word found in the repo should be added there.

It is recommended that VS Code users install the [Code Spell
Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker).
A simple way to add new words to the config is to do `Ctrl/Cmd` + `.`
and add to the cspell.json config. Image below.


![image](https://github.com/user-attachments/assets/fcbea441-8445-4192-a612-c6a8ad1b9ed0)

Also to be notes, this cspell check runs on all touched file, so in case
you're touching a file that has a couple of spell problems, you may need
to add it to the cspell.json config.
  • Loading branch information
shreyan-gupta authored Jan 23, 2025
1 parent dcc416e commit 2937ea8
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ jobs:
tool: just
- run: just doctests

spellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: streetsidesoftware/cspell-action@v6

check_cargo_deny:
name: "Cargo Deny"
runs-on: ubuntu-latest
Expand Down Expand Up @@ -388,7 +394,7 @@ jobs:
pattern: coverage-codecov-*
merge-multiple: true
# Keep the number of uploads here in sync with codecov.yml’s after_n_build value
# codecov will send a comment only after having receidev this number of uploads.
# codecov will send a comment only after having received this number of uploads.
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
with:
files: unit-linux.json
Expand Down
104 changes: 104 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"version": "0.2",
"ignorePaths": [],
"dictionaryDefinitions": [],
"dictionaries": [],
"words": [
"acks",
"actix",
"Aleksandr",
"allocs",
"archivals",
"backpressure",
"Banasik",
"bitvec",
"borsh",
"bufbuild",
"bytesize",
"chrono",
"Chudas",
"cloneable",
"Clippy",
"datas",
"dealloc",
"deallocate",
"deallocating",
"deallocation",
"demultiplexing",
"Deque",
"Diop",
"doctests",
"doomslug",
"fmtr",
"forknet",
"freelist",
"freelists",
"itertools",
"itoa",
"kickout",
"Kickouts",
"Logunov",
"memtrie",
"memtries",
"Merkle",
"merklize",
"metadatas",
"mocknet",
"multinode",
"nearcore",
"neard",
"nextest",
"nums",
"oneshot",
"Prefetcher",
"prefetchers",
"profraw",
"profraws",
"pytest",
"pytests",
"refcount",
"refcounted",
"refcounting",
"reindexing",
"repr",
"reshard",
"resharded",
"Resharder",
"Resharding",
"reshardings",
"respawn",
"respawns",
"rocksdb",
"RUSTC",
"RUSTFLAGS",
"rtype",
"serde",
"Shreyan",
"Spurio",
"stdx",
"structs",
"subslice",
"taiki",
"tempfile",
"TERA",
"testlib",
"testloop",
"testonly",
"TGAS",
"thiserror",
"udeps",
"uids",
"unittests",
"unstake",
"unsync",
"wacban",
"Waclaw",
"wasmer",
"wasms",
"yocto",
"zstd",
"Zulip"
],
"ignoreWords": [],
"import": []
}

0 comments on commit 2937ea8

Please sign in to comment.