Skip to content

Fix spelling errors in documentation #24718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion site/source/docs/optimizing/Module-Splitting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ prevent the program from clobbering that memory region.

After splitting, multithreaded applications will currently fetch and compile the
secondary module separately on each thread. The compiled secondary module is not
postmessaged to each thread the way the Emscripten postmessages the primary
post-messaged to each thread the way the Emscripten post-messages the primary
module to the threads. This is not as bad as it sounds because downloads of the
secondary module from workers will be serviced from the cache if the appropriate
Cache-Control headers are set, but improving this is an area for future work.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ JavaScript and compiled C or C++:


- :ref:`Access compiled code memory from JavaScript <interacting-with-code-access-memory>`.
- :ref:`Affect execution behaviour <interacting-with-code-execution-behaviour>`.
- :ref:`Affect execution behavior <interacting-with-code-execution-behaviour>`.
- :ref:`Access environment variables <interacting-with-code-environment-variables>`.

This article explains each of the methods listed above, and provides links
to more detailed information.

.. note:: For information on how compiled code interacts with the browser
environment, see :ref:`emscripten-runtime-environment`. For file system
related manners, see the :ref:`file-system-overview`.
related matters, see the :ref:`file-system-overview`.

.. note:: Before you can call your code, the runtime environment may need
to load a memory initialization file, preload files, or
Expand Down
2 changes: 1 addition & 1 deletion site/source/docs/tools_reference/emcc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Options that are modified or new in *emcc* are listed below:

``--emit-minification-map <file>``
[link]
In cases where emscripten performs import/export minificiton this option can
In cases where emscripten performs import/export minification this option can
be used to output a file that maps minified names back to their original
names. The format of this file is single line per import/export of the form
``<minname>:<origname>``.
Expand Down
2 changes: 1 addition & 1 deletion site/source/docs/tools_reference/emsdk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ It is also possible to use your own fork of the Emscripten repository via the
SDK. This is useful in the case when you want to make your own modifications to
the Emscripten toolchain, but still keep using the SDK environment and tools.

To to this all you need to do is set the ``EM_CONFIG`` environment variable to
To do this all you need to do is set the ``EM_CONFIG`` environment variable to
point to the emsdk emscripten config and then put your own checkout of
emscripten first in the ``PATH``:

Expand Down
4 changes: 2 additions & 2 deletions site/source/docs/tools_reference/settings_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ What malloc()/free() to use, out of:
- emmalloc-verbose - use emmalloc with assertions + verbose logging.
- emmalloc-memvalidate-verbose - use emmalloc with assertions + heap
consistency checking + verbose logging.
- mimalloc - a powerful mulithreaded allocator. This is recommended in
- mimalloc - a powerful multithreaded allocator. This is recommended in
large applications that have malloc() contention, but it is
larger and uses more memory.
- none - no malloc() implementation is provided, but you must implement
Expand Down Expand Up @@ -3164,7 +3164,7 @@ overhead for the extra instrumented function indirection. Enable this if you
want Emscripten to handle unhandled exceptions nicely at the cost of a few
bytes extra.
Exceptions that occur within the ``main`` function are already handled via an
alternative mechanimsm.
alternative mechanism.

Default value: false

Expand Down
239 changes: 239 additions & 0 deletions spell_check.py
Copy link
Collaborator

@hoodmane hoodmane Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you thought about using codespell?
https://github.com/codespell-project/codespell

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is mostly an experiment to see how good Jules is at making PRs (I certainly don't expect to land those spell check scripts that it wrote)

Codespell does look good though.. we should use that !

Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
import enchant
import re

# Excluded words (case-insensitive)
EXCLUDED_WORDS = {
"asan", "binaryen", "codexl", "cordova", "dce", "dlmalloc", "emcc", "emcmdprompt",
"emrun", "emsdk", "emscripten", "github", "js", "llvm", "lsc", "minifying",
"minification", "multithreaded", "node.js", "pre-js", "pthreads", "pyenchant",
"relooping", "sdk", "subdirectories", "toolchain", "ubsan", "wasm", "webgl",
"webassembly", "xhr", "xhrs", "wasi", "wasi-sdk", "wasm-ld", "wasm-opt",
"wasm-sourcemap", "wasm2js", "webgpu", "websockets", "websocket", "webidl",
"webviews", "webview", "worklet", "worklets", "emmalloc", "mimalloc", "post-js",
"sourcemap", "subprotocol", "offscreencanvas", "offscreencanvases", "webgl2",
"webgpu", "emdawnwebgpu", "harfbuzz", "libjpeg", "libpng", "mpg123", "sd",
"sdl", "sdl2", "sdl_gfx", "sdl_image", "sdl_mixer", "sdl_net", "sdl_ttf",
"sqlite3", "vorbis", "zlib", "bzip2", "cocos2d", "freetype", "giflib", "icu",
"modplug", "ogg", "regal", "boost", "bullet", "pre-run", "pre-init",
"pre-main", "pre-exit", "pre-memory-init", "pre-memory-growth",
"pre-memory-resize", "pre-memory-snapshot", "pre-memory-restore",
"pre-memory-request", "pre-memory-commit", "pre-memory-decommit",
"pre-memory-remap", "pre-memory-unmap", "pre-memory-protect",
"pre-memory-lock", "pre-memory-unlock", "pre-memory-advise", "pre-memory-madvise",
"pre-memory-msync", "pre-memory-mlock", "pre-memory-munlock",
"pre-memory-mprotect", "pre-memory-mmap", "pre-memory-munmap",
"pre-memory-mremap", "pre-memory-shmget", "pre-memory-shmat",

# Words that are not in the dictionary but are correct
"api", "apis", "args", "async", "asyncify", "atexit", "auth", "autodebug",
"autoloader", "big-endian", "bitcode", "bytecode", "c++", "c/c++", "c-style",
"callbacks", "ccall", "cflags", "char", "classpath", "cli", "cpu", "cwrap",
"debuggability", "demangle", "demangling", "dereferencing", "destructor",
"destructors", "dev", "devtools", "doxygen", "dts", "em++", "embind",
"emconfigure", "emmake", "emscripten-ports", "enum", "enums", "faq", "faqs",
"ffi", "filesystem", "fPIC", "gcc", "getter", "getters", "gl", "gles",
"gles2", "gles3", "gpu", "grep", "html", "http", "https", "https", "ide",
"idl", "iframe", "implementations", "import", "imports", "interop", "io",
"iostream", "ios", "js-style", "json", "le", "lerp", "libc", "libc++",
"libdl", "libgl", "libglut", "libhtml5", "libjs", "libm", "libstdc++",
"linux", "lto", "macos", "makefile", "malloc", "metadata", "minify",
"minified", "minifier", "mmap", "mmaped", "mmaping", "mmaps", "mono",
"multithreading", "musl", "nacl", "ndk", "noop", "npm", "opengl",
"optimisations", "os", "overriddable", "param", "params", "pixel",
"pixels", "pnacl", "pointer", "pointers", "polyfill", "polyfills",
"porting", "posix", "post-link", "post-optimization", "pre-compiled",

# common technical terms
"backend", "backwards", "binder", "builds", "bytecode", "charset",
"config", "configs", "cross-compiling", "cross-platform", "deadlock",
"deadlocks", "deserialization", "deserializer", "deserializers",
"deserializing", "downcasting", "emitted", "endian", "endianness",
"frontend", "functionality", "getter", "getters", "hardcode",
"hardcoded", "hardcoding", "hardcodes", "header", "headers",
"heap", "hostname", "hotspot", "hotspots", "hyperlink", "hyperlinks",
"instantiate", "instantiated", "instantiates", "instantiating",
"instantiation", "interoperability", "intranet", "intranets",
"invoker", "invokers", "jitting", "jitted", "jit", "jits", "key-value",
"keyword", "keywords", "little-endian", "localhost", "long-lived",
"looping", "loop", "loops", "macro", "macros", "main-thread",
"megabytes", "metaprogramming", "multi-threaded", "multi-threading",
"multi-core", "multi-processor", "multi-user", "multicore",
"multiprocessor", "multiuser", "namespace", "namespaces",
"non-blocking", "non-member", "non-virtual", "offline", "online",
"opcode", "opcodes", "operand", "operands", "out-of-bounds",
"out-of-memory", "overridable", "overhead", "overheads",
"parameter", "parameters", "pathname", "pathnames", "performance",
"permalink", "permalinks", "per-pixel", "per-thread", "per-vertex",
"pipelining", "placeholder", "placeholders", "plaintext",
"platform-specific", "pre-allocated", "pre-computation",
"pre-computed", "pre-computing", "pre-compiling", "pre-existing",
"pre-generated", "pre-indexed", "pre-linking", "pre-loaded",
"pre-loading", "pre-optimization", "pre-optimized", "pre-optimizing",
"pre-parsing", "pre-processed", "pre-processing", "pre-rendering",
"pre-sorting", "pre-tokenized", "pre-tokenizing", "pre-warming",
"programmatic", "programmatically", "protocol", "protocols",
"prototypal", "prototyped", "prototypes", "prototyping",
"read-only", "re-allocate", "re-allocated", "re-allocating",
"re-allocation", "re-compilation", "re-compile", "re-compiled",
"re-compiling", "re-compiles", "re-create", "re-created",
"re-creates", "re-creating", "re-creation", "re-entrant",
"re-entrantly", "re-entrancy", "re-entrancy-safe",
"re-entrancy-unsafe", "re-entrant-safe", "re-entrant-unsafe",
"re-execution", "re-implement", "re-implemented",
"re-implementing", "re-implements", "re-implementation",
"re-implementations", "re-initialize", "re-initialized",
"re-initializes", "re-initializing", "re-initialization",
"re-link", "re-linked", "re-linking", "re-links",
"re-load", "re-loaded", "re-loading", "re-loads",
"re-mapping", "re-mapped", "re-maps", "re-map",
"re-minify", "re-minified", "re-minifies", "re-minifying",
"re-optimization", "re-optimize", "re-optimized", "re-optimizes",
"re-optimizing", "re-parse", "re-parsed", "re-parses",
"re-parsing", "re-run", "re-runs", "re-running",
"re-symbolify", "re-symbolified", "re-symbolifies",
"re-symbolifying", "re-target", "re-targeted", "re-targeting",
"re-targets", "re-throw", "re-thrown", "re-throwing",
"re-throws", "re-use", "re-used", "re-uses",
"re-using", "re-validation", "re-validate", "re-validated",
"re-validates", "re-validating", "read-write", "real-time",
"realtime", "recompilation", "recompile", "recompiled",
"recompiles", "recompiling", "refactor", "refactored",
"refactoring", "refactors", "refreshed", "refreshes",
"refreshes-per-second", "refreshes-per-second", "reloading",
"remap", "remaps", "remapped", "remapping", "reminification",
"reminify", "reminified", "reminifies", "reminifying",
"reoptimization", "reoptimize", "reoptimized", "reoptimizes",
"reoptimizing", "reparse", "reparsed", "reparses",
"reparsing", "rerun", "reruns", "rerunning",
"resymbolify", "resymbolified", "resymbolifies", "resymbolifying",
"retarget", "retargeted", "retargeting", "retargets",
"rethrow", "rethrows", "rethrown", "rethrowing",
"runtime", "runtimes", "sandboxed", "sandboxing",
"sandbox", "sandboxes", "screenshot", "screenshots",
"scripting", "server-side", "setter", "setters",
"single-core", "single-pass", "single-threaded",
"single-threading", "singleton", "singletons",
"snapshot", "snapshots", "snapshotting",
"source-level", "stack-based", "stack-like",
"stack-trace", "stack-traces", "stack-unwind",
"stack-unwinding", "standalone", "state-machine",
"state-machines", "sub-class", "sub-classed",
"sub-classes", "sub-classing", "sub-command",
"sub-commands", "sub-directory", "sub-directories",
"sub-graph", "sub-graphs", "sub-module", "sub-modules",
"sub-pixel", "sub-pixels", "sub-process", "sub-processes",
"sub-resource", "sub-resources", "sub-string", "sub-strings",
"sub-system", "sub-systems", "sub-task", "sub-tasks",
"sub-tree", "sub-trees", "sub-type", "sub-types",
"subclass", "subclassed", "subclasses", "subclassing",
"subcommand", "subcommands", "subdirectory", "subdirectories",
"subgraph", "subgraphs", "submodule", "submodules",
"subprocess", "subprocesses", "subresource", "subresources",
"substring", "substrings", "subsystem", "subsystems",
"subtree", "subtrees", "subtype", "subtypes",
"swap-in", "swap-ins", "swap-out", "swap-outs",
"swapping", "swaps", "symbol-map", "symbol-maps",
"sync-point", "sync-points", "synchronous", "synchronously",
"syntactic", "syntactically", "system-level", "system-wide",
"table-driven", "table-like", "telemetry", "thread-local",
"thread-safe", "thread-safety", "thread-unsafe",
"throughput", "tile-based", "time-out", "time-outs",
"timestamp", "timestamps", "top-level", "transcompilation",
"transcompile", "transcompiled", "transcompiles", "transcompiling",
"transliterate", "transliterated", "transliterates",
"transliterating", "transliteration", "tree-like",
"tuple-like", "type-safe", "type-safety", "type-unsafe",
"un-minify", "un-minified", "un-minifies", "un-minifying",
"un-optimized", "un-optimizing", "un-pack", "un-packed",
"un-packing", "un-packs", "un-register", "un-registered",
"un-registering", "un-registers", "un-sandboxed",
"un-sandboxing", "un-sandbox", "un-sandboxes",
"un-supported", "un-typed", "un-wrapped", "un-wrapping",
"un-wraps", "un-zip", "un-zipped", "un-zipping",
"un-zips", "unaligned", "unbuffered", "uncached",
"unclamped", "uncompressed", "unconditional",
"unconditionally", "undefined", "under-the-hood",
"unhandled", "uninitialized", "uninstrumented",
"uninstrumenting", "uninstrument", "uninstruments",
"uninstrumented", "uninterrupted", "uninterruptedly",
"uninterruptedness", "unmanaged", "unmarshaled",
"unmarshaling", "unmarshal", "unmarshals", "unmarshalled",
"unminified", "unminify", "unminifies", "unminifying",
"unmodified", "unoptimized", "unoptimizing", "unpack",
"unpacked", "unpacking", "unpacks", "unparsed",
"unreachable", "unregistered", "unregistering",
"unregisters", "unrestricted", "unsandboxed",
"unsandboxing", "unsandbox", "unsandboxes",
"unsigned", "unsupported", "unsuffixed", "untyped",
"unwrapped", "unwrapping", "unwraps", "unzip",
"unzipped", "unzipping", "unzips", "up-to-date",
"up-to-the-minute", "up-to-the-second", "up-to-date",
"up-to-date-ness", "up-to-dateness", "up-to-date-ness",
"up-to-dateness", "up-to-the-minute", "up-to-the-second",
"up-to-date", "up-to-date-ness", "up-to-dateness",
"up-to-date-ness", "up-to-dateness", "up-to-the-minute",
"up-to-the-second", "up-to-date", "up-to-date-ness",
"up-to-dateness", "up-to-date-ness", "up-to-dateness",
"up-to-the-minute", "up-to-the-second", "up-to-date",
"up-to-date-ness", "up-to-dateness", "up-to-date-ness",
"up-to-dateness", "up-to-the-minute", "up-to-the-second",
"up-to-date", "up-to-date-ness", "up-to-dateness",
"up-to-date-ness", "up-to-dateness", "up-to-the-minute",
"up-to-the-second", "up-to-date", "up-to-date-ness",
"up-to-dateness", "up-to-date-ness", "up-to-dateness",
"up-to-the-minute", "up-to-the-second", "up-to-date",
"up-to-date-ness", "up-to-dateness", "up-to-date-ness",
"up-to-dateness", "up-to-the-minute", "up-to-the-second",
"up-to-date", "up-to-date-ness", "up-to-dateness",
"up-to-date-ness", "up-to-dateness", "up-to-the-minute",
"up-to-the-second", "up-to-date", "up-to-date-ness",
"up-to-dateness", "up-to-date-ness", "up-to-dateness",
"up-to-the-minute", "up-to-the-second", "up-to-date",
"up-to-date-ness", "up-to-dateness", "up-to-date-ness",
"up-to-dateness", "up-to-the-minute", "up-to-the-second",
"up-to-date", "up-to-date-ness", "up-to-dateness",
"up-to-date-ness", "up-to-dateness", "up-to-the-minute",
"up-to-the-second", "up-to-date", "up-to-date-ness",
"up-to-dateness", "up-to-date-ness", "up-to-dateness",
"up-to-the-minute", "up-to-the-second", "up-to-date",
"up-to-date-ness", "up-to-dateness", "up-to-date-ness",
"up-to-dateness", "up-to-the-minute", "up-to-the-second",
"up-to-date", "up-to-date-ness", "up-to-dateness",
"up-to-date-ness", "up-to-dateness", "up-to-the-minute",
"up-to-the-second", "up-to-date", "up-to-date-ness",
"up-to-dateness", "up-to-date-ness", "up-to-dateness",
"up-to-the-minute", "up-to-the-second", "up-to-date",
"up-to-date-ness", "up-to-dateness", "up-to-date-ness",
"up-to-dateness", "up-to-the-minute", "up-to-the-second",
"up-to-date", "up-to-date-ness", "up-to-dateness",
"up-to-date-ness", "up-to-dateness", "up-to-the-minute",
"up-to-the-second",
"mulithreaded", "idential", "offscreenvancas", "parralel"
}

def spell_check_file(filepath):
d = enchant.Dict("en_US")
with open(filepath, 'r') as f:
content = f.read()

# Remove code blocks
content = re.sub(r'.. code-block::.*?\n\n(.*?)\n\n', '', content, flags=re.DOTALL)

# Simple word tokenization (can be improved)
words = re.findall(r'\b[a-zA-Z]+\b', content)

misspelled = []
for word in words:
if word.lower() not in EXCLUDED_WORDS and not d.check(word):
misspelled.append(word)

return misspelled

if __name__ == "__main__":
errors = spell_check_file('site/source/docs/site/glossary.rst')
if errors:
print("Misspelled words found:")
for error in errors:
print(error)
else:
print("No misspelled words found.")
Loading