Skip to content

Commit 463fe75

Browse files
authored
[NFC] Fix typos discovered by codespell in the tools directory (#23039)
% `codespell --ignore-words-list=dum,implementor,tre --write-changes tools` * https://pypi.org/project/codespell
1 parent ad8210f commit 463fe75

23 files changed

+35
-35
lines changed

tools/acorn-optimizer.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ function JSDCE(ast, aggressive) {
397397
if (elem) traverse(elem);
398398
}
399399
} else {
400-
assertAt(id.type === 'Identifier', id, `expected Indentifier but found ${id.type}`);
400+
assertAt(id.type === 'Identifier', id, `expected Identifier but found ${id.type}`);
401401
const name = id.name;
402402
ensureData(scopes[scopes.length - 1], name).def = 1;
403403
}
@@ -862,7 +862,7 @@ function emitDCEGraph(ast) {
862862
// must find the info we need
863863
assert(
864864
foundWasmImportsAssign,
865-
'could not find the assigment to "wasmImports". perhaps --pre-js or --post-js code moved it out of the global scope? (things like that should be done after emcc runs, as they do not need to be run through the optimizer which is the special thing about --pre-js/--post-js code)',
865+
'could not find the assignment to "wasmImports". perhaps --pre-js or --post-js code moved it out of the global scope? (things like that should be done after emcc runs, as they do not need to be run through the optimizer which is the special thing about --pre-js/--post-js code)',
866866
);
867867
// Read exports that were declared in extraInfo
868868
if (extraInfo) {
@@ -932,7 +932,7 @@ function emitDCEGraph(ast) {
932932
if (infos[reached]) {
933933
infos[reached].root = true; // in global scope, root it
934934
} else {
935-
// An info might not exist for the identifer if it is missing, for
935+
// An info might not exist for the identifier if it is missing, for
936936
// example, we might call Module.dynCall_vi in library code, but it
937937
// won't exist in a standalone (non-JS) build anyhow. We can ignore
938938
// it in that case as the JS won't be used, but warn to be safe.

tools/create_dom_pk_codes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def hash_all(k1, k2):
239239
return (hashes, str_to_hash)
240240

241241

242-
# Find an approprite hash function that is collision free within the set of all input strings
242+
# Find an appropriate hash function that is collision free within the set of all input strings
243243
# Try hash function format h_i = ((h_(i-1) ^ k_1) << k_2) ^ s_i, where h_i is the hash function
244244
# value at step i, k_1 and k_2 are the constants we are searching, and s_i is the i'th input
245245
# character

tools/emdwp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# University of Illinois/NCSA Open Source License. Both these licenses can be
55
# found in the LICENSE file.
66

7-
"""Wrapper scripte around `llvm-dwp`.
7+
"""Wrapper script around `llvm-dwp`.
88
"""
99

1010
import sys

tools/emnm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# University of Illinois/NCSA Open Source License. Both these licenses can be
55
# found in the LICENSE file.
66

7-
"""Wrapper scripte around `llvm-nm`.
7+
"""Wrapper script around `llvm-nm`.
88
"""
99

1010
import os

tools/emscripten.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ def finalize_wasm(infile, outfile, js_syms):
620620

621621

622622
def create_tsd_exported_runtime_methods(metadata):
623-
# Use the TypeScript compiler to generate defintions for all of the runtime
623+
# Use the TypeScript compiler to generate definitions for all of the runtime
624624
# exports. The JS from the library any JS docs are included in the file used
625625
# for generation.
626626
js_doc = 'var RuntimeExports = {};\n'
@@ -660,7 +660,7 @@ def create_tsd(metadata, embind_tsd):
660660
out = '// TypeScript bindings for emscripten-generated code. Automatically generated at compile time.\n'
661661
if settings.EXPORTED_RUNTIME_METHODS:
662662
out += create_tsd_exported_runtime_methods(metadata)
663-
# Manually generate defintions for any Wasm function exports.
663+
# Manually generate definitions for any Wasm function exports.
664664
out += 'interface WasmModule {\n'
665665
for name, functype in metadata.function_exports.items():
666666
mangled = asmjs_mangle(name)
@@ -683,7 +683,7 @@ def create_tsd(metadata, embind_tsd):
683683
export_interfaces = 'WasmModule'
684684
if settings.EXPORTED_RUNTIME_METHODS:
685685
export_interfaces += ' & typeof RuntimeExports'
686-
# Add in embind defintions.
686+
# Add in embind definitions.
687687
if embind_tsd:
688688
export_interfaces += ' & EmbindModule'
689689
out += f'export type MainModule = {export_interfaces};\n'

tools/experimental/reproduceriter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
make a browser build, record a trace, then make a shell build and copy the trace
9797
there so you can run it.
9898
99-
The last parameter specifies what to do when the event loop is idle: We fire an event and then set onIdle (which was this function) to null, so this is a one-time occurence.
99+
The last parameter specifies what to do when the event loop is idle: We fire an event and then set onIdle (which was this function) to null, so this is a one-time occurrence.
100100
101101
Notes
102102

tools/file_packager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def main():
501501
err('Error: Embedding "%s" which is not contained within the current directory '
502502
'"%s". This is invalid since the current directory becomes the '
503503
'root that the generated code will see. To include files outside of the current '
504-
'working directoty you can use the `--preload-file srcpath@dstpath` syntax to '
504+
'working directory you can use the `--preload-file srcpath@dstpath` syntax to '
505505
'explicitly specify the target location.' % (path, curr_abspath))
506506
sys.exit(1)
507507
file_.dstpath = abspath[len(curr_abspath) + 1:]
@@ -702,7 +702,7 @@ def generate_js(data_target, data_files, metadata):
702702
}\n''' % (create_preloaded if options.use_preload_plugins else create_data)
703703

704704
if options.has_embedded and not options.obj_output:
705-
err('--obj-output is recommended when using --embed. This outputs an object file for linking directly into your application is more effecient than JS encoding')
705+
err('--obj-output is recommended when using --embed. This outputs an object file for linking directly into your application is more efficient than JS encoding')
706706

707707
for counter, file_ in enumerate(data_files):
708708
filename = file_.dstpath

tools/filelock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def release(self, force = False):
301301
"""
302302
Releases the file lock.
303303
304-
Please note, that the lock is only completly released, if the lock
304+
Please note, that the lock is only completely released, if the lock
305305
counter is 0.
306306
307307
Also note, that the lock file itself is not automatically deleted.

tools/line_endings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def convert_line_endings_in_file(filename, from_eol, to_eol):
2626

2727

2828
def check_line_endings(filename, expect_only=None, print_errors=True, print_info=False):
29-
"""Detect inconsitent/invalid line endings.
29+
"""Detect inconsistent/invalid line endings.
3030
3131
This function checks and prints out the detected line endings in the given
3232
file. If the file only contains either Windows \\r\\n line endings or Unix \\n

tools/link.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ def set_max_memory():
590590
if initial_memory_known:
591591
settings.MAXIMUM_MEMORY = settings.INITIAL_MEMORY
592592

593-
# Automaticaly up the default maximum when the user requested a large minimum.
593+
# Automatically up the default maximum when the user requested a large minimum.
594594
if 'MAXIMUM_MEMORY' not in user_settings:
595595
if settings.ALLOW_MEMORY_GROWTH:
596596
if any([settings.INITIAL_HEAP != -1 and settings.INITIAL_HEAP >= 2 * 1024 * 1024 * 1024,
@@ -667,7 +667,7 @@ def phase_linker_setup(options, state, newargs):
667667
options.post_js.append(utils.path_from_root('src/cpuprofiler.js'))
668668

669669
# Unless RUNTIME_DEBUG is explicitly set then we enable it when any of the
670-
# more specfic debug settings are present.
670+
# more specific debug settings are present.
671671
default_setting('RUNTIME_DEBUG', int(settings.LIBRARY_DEBUG or
672672
settings.GL_DEBUG or
673673
settings.DYLINK_DEBUG or
@@ -1934,7 +1934,7 @@ def phase_emscript(in_wasm, wasm_target, js_syms, base_metadata):
19341934
# Emscripten
19351935
logger.debug('emscript')
19361936

1937-
# No need to support base64 embeddeding in wasm2js mode since
1937+
# No need to support base64 embedding in wasm2js mode since
19381938
# the module is already in JS format.
19391939
settings.SUPPORT_BASE64_EMBEDDING = settings.SINGLE_FILE and not settings.WASM2JS
19401940

tools/maint/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Maintenance Scripts for Emscripten Developers
22
=============================================
33

4-
This directory contains maintentance scripts used by emscripten developers. For
4+
This directory contains maintenance scripts used by emscripten developers. For
55
more information see the comments at the top of each script.

tools/maint/check_for_unused_test_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def check_file(dirpath, filename):
8181
if ext == '.json' and grep("'" + os.path.basename(stem) + "'"):
8282
return
8383

84-
# test_asan builds it pathnames programatically based on the basename, so just
84+
# test_asan builds it pathnames programmatically based on the basename, so just
8585
# search for the basename.
8686
if filename.startswith('test_asan_'):
8787
relpath = os.path.basename(relpath)

tools/maint/gen_sig_info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ def extract_sig_info(sig_info, extra_settings=None, extra_cflags=None, cxx=False
374374
def main(args):
375375
parser = argparse.ArgumentParser()
376376
parser.add_argument('-o', '--output', default='src/library_sigs.js')
377-
parser.add_argument('-r', '--remove', action='store_true', help='remove from JS library files any `__sig` entires that are part of the auto-generated file')
378-
parser.add_argument('-u', '--update', action='store_true', help='update with JS library files any `__sig` entires that are part of the auto-generated file')
377+
parser.add_argument('-r', '--remove', action='store_true', help='remove from JS library files any `__sig` entries that are part of the auto-generated file')
378+
parser.add_argument('-u', '--update', action='store_true', help='update with JS library files any `__sig` entries that are part of the auto-generated file')
379379
args = parser.parse_args()
380380

381381
print('generating signatures ...')

tools/ports/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def get_include_dir(*parts):
153153

154154
@staticmethod
155155
def install_header_dir(src_dir, target=None):
156-
"""Like install_headers but recusively copied all files in a directory"""
156+
"""Like install_headers but recursively copied all files in a directory"""
157157
if not target:
158158
target = os.path.basename(src_dir)
159159
dest = Ports.get_include_dir(target)
@@ -404,7 +404,7 @@ def dependency_order(port_list):
404404
# Perform topological sort of ports according to the dependency DAG
405405
port_map = {p.name: p for p in port_list}
406406

407-
# Perform depth first search of dependecy graph adding nodes to
407+
# Perform depth first search of dependency graph adding nodes to
408408
# the stack only after all children have been explored.
409409
stack = []
410410
unsorted = OrderedSet(port_list)

tools/ports/sqlite3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# University of Illinois/NCSA Open Source License. Both these licenses can be
44
# found in the LICENSE file.
55

6-
# sqlite amalgamation download URL uses relase year and tag
6+
# sqlite amalgamation download URL uses release year and tag
77
# 2022 and (3, 38, 5) -> '/2022/sqlite-amalgamation-3380500.zip'
88
VERSION = (3, 39, 0)
99
VERSION_YEAR = 2022

tools/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def read_js_settings(filename, attrs):
160160
with open(filename) as fh:
161161
settings = fh.read()
162162
# Use a bunch of regexs to convert the file from JS to python
163-
# TODO(sbc): This is kind hacky and we should probably covert
163+
# TODO(sbc): This is kind hacky and we should probably convert
164164
# this file in format that python can read directly (since we
165165
# no longer read this file from JS at all).
166166
settings = settings.replace('//', '#')
@@ -273,7 +273,7 @@ def check_type(self, name, value):
273273
expected_type = self.types.get(name)
274274
if not expected_type:
275275
return
276-
# Allow itegers 1 and 0 for type `bool`
276+
# Allow integers 1 and 0 for type `bool`
277277
if expected_type == bool:
278278
if value in (1, 0):
279279
value = bool(value)

tools/shared.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def shlex_join(cmd):
116116
def run_process(cmd, check=True, input=None, *args, **kw):
117117
"""Runs a subprocess returning the exit code.
118118
119-
By default this function will raise an exception on failure. Therefor this should only be
119+
By default this function will raise an exception on failure. Therefore this should only be
120120
used if you want to handle such failures. For most subprocesses, failures are not recoverable
121121
and should be fatal. In those cases the `check_call` wrapper should be preferred.
122122
"""
@@ -511,7 +511,7 @@ def sanity_is_correct():
511511
return
512512

513513
with cache.lock('sanity'):
514-
# Check again once the cache lock as aquired
514+
# Check again once the cache lock as acquired
515515
if sanity_is_correct():
516516
return
517517

tools/system_libs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ class libmalloc(MTLibrary):
17101710

17111711
cflags = ['-fno-builtin', '-Wno-unused-function', '-Wno-unused-but-set-variable', '-Wno-unused-variable']
17121712
# malloc/free/calloc are runtime functions and can be generated during LTO
1713-
# Therefor they cannot themselves be part of LTO.
1713+
# Therefore they cannot themselves be part of LTO.
17141714
force_object_files = True
17151715

17161716
def __init__(self, **kwargs):
@@ -1810,7 +1810,7 @@ class libmimalloc(MTLibrary):
18101810
]
18111811

18121812
# malloc/free/calloc are runtime functions and can be generated during LTO
1813-
# Therefor they cannot themselves be part of LTO.
1813+
# Therefore they cannot themselves be part of LTO.
18141814
force_object_files = True
18151815

18161816
includes = ['system/lib/mimalloc/include']

tools/toolchain_profiler.results_template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@
631631
.duration(500)
632632
.style("opacity", 0);
633633
}
634-
// upate the item rects
634+
// update the item rects
635635
var rects = itemRects.selectAll('rect')
636636
.data(visItems, function (d) { return d.id; })
637637
.attr('x', function(d) { return x1(d.start); })

tools/unsafe_optimizations.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function optPassRemoveRedundantOperatorNews(ast) {
7575
// referenced (a least in some builds).
7676
//
7777
// Another exception is made for `new WebAssembly.*` since we create and
78-
// unused `WebAssembly.Memory` when probing for wasm64 fatures.
78+
// unused `WebAssembly.Memory` when probing for wasm64 features.
7979
if (
8080
n.expression.callee.name !== 'Promise' &&
8181
n.expression.callee.object?.name !== 'WebAssembly'

tools/webassembly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# University of Illinois/NCSA Open Source License. Both these licenses can be
44
# found in the LICENSE file.
55

6-
"""Utilties for manipulating WebAssembly binaries from python.
6+
"""Utilities for manipulating WebAssembly binaries from python.
77
"""
88

99
from collections import namedtuple

tools/webidl_binder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ def add_bounds_check_impl():
693693
continue
694694
implements[name] = [js_impl[0]]
695695

696-
# Compute the height in the inheritance tree of each node. Note that the order of interation
696+
# Compute the height in the inheritance tree of each node. Note that the order of iteration
697697
# of `implements` is irrelevant.
698698
#
699699
# After one iteration of the loop, all ancestors of child are guaranteed to have a larger

tools/websocket_to_posix_proxy/src/websocket_to_posix_proxy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,7 @@ void ProcessWebSocketMessage(int client_fd, uint8_t *payload, uint64_t numBytes)
15991599
header->function == POSIX_SOCKET_MSG_RECVMSG ||
16001600
header->function == POSIX_SOCKET_MSG_CONNECT ||
16011601
header->function == POSIX_SOCKET_MSG_ACCEPT) {
1602-
// Synchonous/blocking recv()s can halt indefinitely until a message is actually received. An application might
1602+
// Synchronous/blocking recv()s can halt indefinitely until a message is actually received. An application might
16031603
// be send()ing messages in one thread while using another thread to wait for recv(). Therefore run these potentially
16041604
// blocking recv()s in a separate thread. The nonblocking operations can run synchronously in calling thread (they could
16051605
// also run in a background thread, but for performance, do not offload them since it is not necessary)

0 commit comments

Comments
 (0)