Skip to content

Commit 238270f

Browse files
authored
Merge pull request #42458 from jsoref/spelling-utils
Spelling utils
2 parents c87d7ae + 5460443 commit 238270f

29 files changed

+42
-42
lines changed

utils/analyze_code_size.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,14 +440,14 @@ def print_summary(self, section_size):
440440
(category[0], category[1], category[2]))
441441
print("%60s: %8d (%6.2f%%)" % ('TOTAL', total_size, float(100)))
442442

443-
def uncatorizedSymbols(self):
443+
def uncategorizedSymbols(self):
444444
category = self.categories.get('Unknown')
445445
if category:
446446
return category.symbols
447447
return None
448448

449449
def print_uncategorizedSymbols(self):
450-
syms = self.uncatorizedSymbols()
450+
syms = self.uncategorizedSymbols()
451451
if syms:
452452
for symbol in syms:
453453
print(symbol.mangled_name + " " + symbol.name + " " +

utils/api_checker/swift-api-checker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,12 @@ def main():
260260
basic_group.add_argument('--separate-by-module',
261261
action='store_true',
262262
help='When importing entire SDK, dump content '
263-
'seprately by module names')
263+
'separately by module names')
264264

265265
basic_group.add_argument('--zippered',
266266
action='store_true',
267267
help='dump module content to a dir with files for'
268-
'seprately targets')
268+
'separately targets')
269269

270270
basic_group.add_argument('--abi',
271271
action='store_true',

utils/bug_reducer/bug_reducer/func_bug_reducer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def function_bug_reducer(input_file, nm, sil_opt_invoker, sil_extract_invoker,
100100

101101
print("Base case crashes! Trying to reduce *.sib file")
102102

103-
# Otherwise, reduce the list of pases that cause the optimzier to crash.
103+
# Otherwise, reduce the list of pases that cause the optimizer to crash.
104104
tester = OptimizerTester(sil_opt_invoker, pass_list)
105105
r = ReduceMiscompilingFunctions(functions, sil_extract_invoker,
106106
tester)

utils/build-presets.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,7 @@ skip-test-foundation
16931693
skip-test-libdispatch
16941694
skip-test-xctest
16951695

1696-
# Builds enough of the the toolchain to build a swift pacakge on macOS.
1696+
# Builds enough of the toolchain to build a swift package on macOS.
16971697
[preset: mixin_swiftpm_package_macos_platform]
16981698
mixin-preset=mixin_swiftpm_macos_platform
16991699

@@ -1708,7 +1708,7 @@ skip-watchos
17081708
skip-test-llbuild
17091709
skip-test-swiftpm
17101710

1711-
# Builds enough of the the toolchain to build a swift pacakge on Linux.
1711+
# Builds enough of the toolchain to build a swift package on Linux.
17121712
[preset: mixin_swiftpm_package_linux_platform]
17131713
mixin-preset=mixin_swiftpm_linux_platform
17141714

utils/build-script-impl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ umask 0022
3333
# The --skip-build parameter, with no product name, does not affect the
3434
# configuration (CMake parameters). You can turn this option on and
3535
# off in different invocations of the script for the same build
36-
# directory without affecting configutation.
36+
# directory without affecting configuration.
3737
#
3838
# skip-build-* and build-* parameters affect the CMake configuration
3939
# (enable/disable those components).
@@ -3442,10 +3442,10 @@ for host in "${ALL_HOSTS[@]}"; do
34423442
# The usage for this script says that lipo happens before
34433443
# dsym extraction but that's not really what happens. At this point,
34443444
# we're processing an individual host (eg macosx-x86_64) but targeting
3445-
# the (shared) SYMROOT which can cause mutliple hosts to stomp on each
3445+
# the (shared) SYMROOT which can cause multiple hosts to stomp on each
34463446
# other. As a hack, I'm segregating the hosts in the symroot but it
34473447
# would probably be better to make the script behave as the usage
3448-
# descibes
3448+
# describes
34493449
host_symroot="${INSTALL_SYMROOT}/${host}"
34503450

34513451
set -x

utils/build-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function usage() {
3636
echo "Customize the preset invoked by prepending a prefix"
3737
echo ""
3838
echo "--use-os-runtime"
39-
echo "Require this toolchain to link against against the OS runtime rather than the toolchains packaged runtime"
39+
echo "Require this toolchain to link against the OS runtime rather than the toolchains packaged runtime"
4040
echo ""
4141
}
4242

utils/build-tooling-libs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# utils/build-tooling-libs - Helper tool for building the SwiftSyntax paresr
2+
# utils/build-tooling-libs - Helper tool for building the SwiftSyntax parser
33
# and SwiftStaticMirror libraries -*- python -*-
44
#
55
# This source file is part of the Swift.org open source project

utils/build-windows.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
:: - REPO_SCHEME: Optional. The scheme name to checkout.
1818

1919
:: REQUIRED PERMISSIONS
20-
:: Practically, it is easier to be in the Adminstrators group to run the
20+
:: Practically, it is easier to be in the Administrators group to run the
2121
:: script, but it should be possible to execute as a normal user.
2222
:: The user will need permission to write files into the Windows SDK and the
2323
:: VisualC++ folder.

utils/build_swift/build_swift/argparse/actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def __init__(self, option_strings, **kwargs):
320320
# -----------------------------------------------------------------------------
321321

322322
class UnsupportedAction(Action):
323-
"""Action that denotes an unsupported argument or opiton and subsequently
323+
"""Action that denotes an unsupported argument or option and subsequently
324324
raises an ArgumentError.
325325
"""
326326

utils/build_swift/build_swift/argparse/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __call__(self, *args):
7070

7171
class _PartialAction(Action):
7272
"""Action that is partially applied, creating a factory closure used to
73-
defer initialization of acitons in the builder DSL.
73+
defer initialization of actions in the builder DSL.
7474
"""
7575

7676
def __init__(self, action_class):
@@ -185,7 +185,7 @@ def mutually_exclusive_group(self, **kwargs):
185185
# -----------------------------------------------------------------------------
186186

187187
class ArgumentParser(argparse.ArgumentParser):
188-
"""A thin extension class to the standard ArgumentParser which incluldes
188+
"""A thin extension class to the standard ArgumentParser which includes
189189
methods to interact with a builder instance.
190190
"""
191191

utils/build_swift/build_swift/cache_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
"""
11-
Cache related utitlity functions and decorators.
11+
Cache related utility functions and decorators.
1212
"""
1313

1414
import functools

utils/build_swift/build_swift/defaults.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _default_llvm_lto_link_jobs():
8484
"""Use the formula (GB Memory - 3)/6.0GB to get the number of parallel
8585
link threads we can support. This gives the OS 3 GB of room to work with.
8686
87-
This is a bit conservative, but I have found that this hueristic prevents
87+
This is a bit conservative, but I have found that this heuristic prevents
8888
me from swapping on my test machine.
8989
"""
9090

@@ -99,7 +99,7 @@ def _default_swift_lto_link_jobs():
9999
"""Use the formula (GB Memory - 3)/8.0GB to get the number of parallel
100100
link threads we can support. This gives the OS 3 GB of room to work with.
101101
102-
This is a bit conservative, but I have found that this hueristic prevents
102+
This is a bit conservative, but I have found that this heuristic prevents
103103
me from swapping on my test machine.
104104
"""
105105

utils/build_swift/build_swift/presets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def __str__(self):
116116

117117

118118
class DuplicatePresetError(PresetError):
119-
"""Raised when an existing preset would be overriden.
119+
"""Raised when an existing preset would be overridden.
120120
"""
121121

122122
def __init__(self, preset_name):
@@ -306,7 +306,7 @@ def read_files(self, filenames):
306306
@_catch_duplicate_option_error
307307
@_catch_duplicate_section_error
308308
def read_string(self, string):
309-
"""Reads and parses a string containing preset definintions.
309+
"""Reads and parses a string containing preset definitions.
310310
"""
311311

312312
fp = io.StringIO(string)

utils/build_swift/tests/build_swift/argparse/test_actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def test_last_wins(self):
390390
self.assertFalse(args.foo)
391391

392392

393-
class TestUnuspportedAction(unittest.TestCase):
393+
class TestUnsupportedAction(unittest.TestCase):
394394

395395
def test_default_attributes(self):
396396
action = actions.UnsupportedAction(['--foo'])

utils/build_swift/tests/build_swift/argparse/test_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def test_assert_exists(self):
9797
path_type(__file__)
9898

9999
with self.assertRaises(ArgumentTypeError):
100-
path_type('/nonsensisal/path/')
100+
path_type('/nonsensical/path/')
101101

102102
with self.assertRaises(ArgumentTypeError):
103103
path_type('~/not-a-real/path to a file')

utils/build_swift/tests/build_swift/test_driver_arguments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def test(self):
278278
[option.option_string])
279279
# The argument should never show up in the namespace
280280
self.assertFalse(hasattr(namespace, option.dest))
281-
# It should instead be forwareded to unknown_args
281+
# It should instead be forwarded to unknown_args
282282
self.assertEqual(unknown_args, [option.option_string])
283283

284284
return test

utils/build_swift/tests/build_swift/test_migration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def _get_sdk_target_names(sdk_names):
3333

3434

3535
# -----------------------------------------------------------------------------
36-
# Mirgrate Swift SDKs
36+
# Migrate Swift SDKs
3737

3838
class TestMigrateSwiftSDKsMeta(type):
3939
"""Metaclass used to dynamically generate test methods.

utils/build_swift/tests/build_swift/test_presets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
'darwin_toolchain_alias': 'Alias',
3030
'darwin_toolchain_bundle_identifier': 'BundleIdentifier',
3131
'darwin_toolchain_display_name': 'DisplayName',
32-
'darwin_toolchain_display_name_short': 'DispalyNameShort',
32+
'darwin_toolchain_display_name_short': 'DisplayNameShort',
3333
'darwin_toolchain_version': '1.0',
3434
'darwin_toolchain_xctoolchain_name': 'default',
3535
'extra_swift_args': '',

utils/build_swift/tests/build_swift/test_shell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ class TestSubprocessWrappers(unittest.TestCase):
279279

280280
# NOTE: Testing the Popen class is harder than it might appear. We're not
281281
# able to mock out the subprocess.Popen superclass as one might initially
282-
# expect. Rather that shell.Popen class object already exists and inherts
282+
# expect. Rather that shell.Popen class object already exists and inherits
283283
# from subprocess.Popen, thus mocking it out does not change the behavior.
284284
# Ultimately this class is merely a wrapper that uses already tested
285285
# decorators to add functionality so testing here might not provide any

utils/build_swift/tests/expected_options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ class DisableOption(_BaseOption):
366366

367367

368368
class ChoicesOption(_BaseOption):
369-
"""Option that accepts an argument from a predifined list of choices."""
369+
"""Option that accepts an argument from a predefined list of choices."""
370370

371371
def __init__(self, *args, **kwargs):
372372
self.choices = kwargs.pop('choices', None)
@@ -752,7 +752,7 @@ class BuildScriptImplOption(_BaseOption):
752752
UnsupportedOption('--skip-test-optimize-none-with-implicit-dynamic'),
753753
UnsupportedOption('--skip-test-optimized'),
754754

755-
# Options forwared to build-script-impl
755+
# Options forwarded to build-script-impl
756756
BuildScriptImplOption('--skip-test-swift', dest='impl_skip_test_swift'),
757757
BuildScriptImplOption('--install-swift', dest='impl_install_swift'),
758758

utils/incrparse/incr_transfer_round_trip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def main():
6767
# markup for testing incremental parsing
6868
# =========================================================================
6969

70-
# Gather command line arguments for swift-syntax-test specifiying the
70+
# Gather command line arguments for swift-syntax-test specifying the
7171
# performed edits in this list
7272
incremental_edit_args = []
7373
reparse_args = []

utils/incrparse/test_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def serializeIncrParseMarkupFile(test_file, test_case, mode,
166166
# markup for testing incremental parsing
167167
# =========================================================================
168168

169-
# Gather command line arguments for swift-syntax-test specifiying the
169+
# Gather command line arguments for swift-syntax-test specifying the
170170
# performed edits in this list
171171
incremental_edit_args = []
172172
reparse_args = []
@@ -237,7 +237,7 @@ def main():
237237
description='Utility for testing incremental syntax parsing',
238238
epilog='''
239239
This utility can parse a special markup to dedicate a pre-edit and a
240-
post-edit version of a file simulateously and generate a serialized version
240+
post-edit version of a file simultaneously and generate a serialized version
241241
of the libSyntax tree by parsing either the pre-edit file, the post-edit
242242
file or the edits that are required to retrieve the post-edit file from the
243243
pre-edit file incrementally.

utils/python_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def parse_args():
113113
parser.add_argument(
114114
"--check",
115115
action="store_true",
116-
help="Don't format the file, just retun the status.",
116+
help="Don't format the file, just return the status.",
117117
)
118118

119119
parser.add_argument(

utils/scale-test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def Nelder_Mead_simplex(objective, params, bounds, epsilon=1.0e-6):
358358
# objective-at-those-params and the data. Then runs a simple
359359
# coordinate_descent nonlinear optimization on the parameter space until it
360360
# converges. Then calculates the r_squared (coefficient of determination
361-
# a.k.a. goodness-of-fit, a number betwee 0 and 1 with 1 meaning "fits
361+
# a.k.a. goodness-of-fit, a number between 0 and 1 with 1 meaning "fits
362362
# perfectly") and finally returns (fit_params, r_squared).
363363
def fit_function_to_data_by_least_squares(objective, params, bounds, xs, ys):
364364

utils/swift_build_support/swift_build_support/build_script_invocation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ def compute_product_pipelines(self):
571571
# Otherwise, we build an "early" swift-driver using the host
572572
# toolchain, which the later-built compiler will forward
573573
# `swiftc` invocations to. That is, if we find a Swift compiler
574-
# in the host toolchain. If the host toolchain is not equpipped with
574+
# in the host toolchain. If the host toolchain is not equipped with
575575
# a Swift compiler, a warning is emitted. In the future, it may become
576576
# mandatory that the host toolchain come with its own `swiftc`.
577577
builder.add_product(products.EarlySwiftDriver,

utils/swift_build_support/swift_build_support/products/swiftsyntax.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ def should_install(self, host_target):
101101
return self.args.install_swiftsyntax
102102

103103
def install(self, target_name):
104-
# SwiftSyntax doesn't produce any products thate should be installed
105-
# into the toolchein. All tools using it link against SwiftSyntax
104+
# SwiftSyntax doesn't produce any products that should be installed
105+
# into the toolchain. All tools using it link against SwiftSyntax
106106
# statically.
107107
pass
108108

utils/swift_build_support/swift_build_support/targets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def install_prefix():
430430

431431
def darwin_toolchain_prefix(darwin_install_prefix):
432432
"""
433-
Given the install prefix for a Darwin system, and assuming that that path
433+
Given the install prefix for a Darwin system, and assuming that path
434434
is to a .xctoolchain directory, return the path to the .xctoolchain
435435
directory.
436436
"""
@@ -439,7 +439,7 @@ def darwin_toolchain_prefix(darwin_install_prefix):
439439

440440
def toolchain_path(install_destdir, install_prefix):
441441
"""
442-
Given the install prefix for a Darwin system, and assuming that that path
442+
Given the install prefix for a Darwin system, and assuming that path
443443
is to a .xctoolchain directory, return the path to the .xctoolchain
444444
directory in the given install directory.
445445
This toolchain is being populated during the build-script invocation.

utils/type-layout-fuzzer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def struct():
131131
print("}")
132132
print()
133133

134-
def clas():
134+
def clazz():
135135
defineRandomClass(name, depth)
136136

137137
def enum():
@@ -145,7 +145,7 @@ def enum():
145145
print("}")
146146
print()
147147

148-
kinds = [struct, clas, enum]
148+
kinds = [struct, clazz, enum]
149149
return random.choice(kinds)()
150150

151151

utils/update_checkout/update_checkout/update_checkout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def skip_list_for_platform(config, all_repos):
461461
return [] # Do not skip any platform-specific repositories
462462

463463
# If there is a platforms key only include the repo if the
464-
# plaform is in the list
464+
# platform is in the list
465465
skip_list = []
466466
platform_name = platform.system()
467467

0 commit comments

Comments
 (0)