Skip to content

Commit 9ea92f4

Browse files
authored
Merge pull request swiftlang#20829 from palimondo/not-fish-snake-scale
2 parents 5296a94 + df9ac32 commit 9ea92f4

File tree

19 files changed

+193
-250
lines changed

19 files changed

+193
-250
lines changed

utils/cmpcodesize/cmpcodesize/compare.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def compare_sizes(old_sizes, new_sizes, name_key, title, total_size_key="",
169169

170170
if total_size_key:
171171
if csv:
172-
csv.writerow([title, name_key,
172+
csv.writerow([title, name_key,
173173
old_size, old_size * 100.0 / old_total_size,
174174
new_size, new_size * 100.0 / new_total_size,
175175
perc])
@@ -190,7 +190,7 @@ def compare_sizes(old_sizes, new_sizes, name_key, title, total_size_key="",
190190
(title, name_key, old_size, new_size, perc))
191191

192192

193-
def compare_sizes_of_file(old_files, new_files, all_sections, list_categories,
193+
def compare_sizes_of_file(old_files, new_files, all_sections, list_categories,
194194
csv=None):
195195
old_sizes = collections.defaultdict(int)
196196
new_sizes = collections.defaultdict(int)
@@ -214,13 +214,13 @@ def compare_sizes_of_file(old_files, new_files, all_sections, list_categories,
214214
if list_categories:
215215
for cat in categories:
216216
cat_name = cat[0]
217-
compare_sizes(old_sizes, new_sizes, cat_name, "", "__text",
217+
compare_sizes(old_sizes, new_sizes, cat_name, "", "__text",
218218
csv=csv)
219219

220220
if all_sections:
221221
section_title = " section"
222222

223-
compare_sizes(old_sizes, new_sizes, "__textcoal_nt", section_title,
223+
compare_sizes(old_sizes, new_sizes, "__textcoal_nt", section_title,
224224
csv=csv)
225225
compare_sizes(old_sizes, new_sizes, "__stubs", section_title, csv=csv)
226226
compare_sizes(old_sizes, new_sizes, "__const", section_title, csv=csv)

utils/cmpcodesize/cmpcodesize/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def main():
203203
if parsed_arguments.sum_sizes:
204204
compare_sizes_of_file(old_files, new_files,
205205
parsed_arguments.all_sections,
206-
parsed_arguments.list_categories,
206+
parsed_arguments.list_categories,
207207
csv=csv_out)
208208
else:
209209
if len(old_files) != len(new_files):

utils/generate_confusables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# utils/update_confusables.py - Utility to update definitions of unicode
2+
# utils/update_confusables.py - Utility to update definitions of unicode
33
# confusables
44
#
55
# This source file is part of the Swift.org open source project

utils/gyb_benchmark_support.py

Lines changed: 0 additions & 60 deletions
This file was deleted.

utils/gyb_sourcekit_support/UIDs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(self, internal_name, external_name):
5050
KEY('SourceText', 'key.sourcetext'),
5151
KEY('EnableSyntaxMap', 'key.enablesyntaxmap'),
5252
KEY('SyntaxTreeTransferMode', 'key.syntaxtreetransfermode'),
53-
KEY('SyntaxTreeSerializationFormat',
53+
KEY('SyntaxTreeSerializationFormat',
5454
'key.syntax_tree_serialization_format'),
5555
KEY('EnableStructure', 'key.enablesubstructure'),
5656
KEY('Description', 'key.description'),
@@ -413,8 +413,8 @@ def __init__(self, internal_name, external_name):
413413
KIND('SyntaxTreeOff', 'source.syntaxtree.transfer.off'),
414414
KIND('SyntaxTreeIncremental', 'source.syntaxtree.transfer.incremental'),
415415
KIND('SyntaxTreeFull', 'source.syntaxtree.transfer.full'),
416-
KIND('SyntaxTreeSerializationJSON',
416+
KIND('SyntaxTreeSerializationJSON',
417417
'source.syntaxtree.serialization.format.json'),
418-
KIND('SyntaxTreeSerializationByteTree',
418+
KIND('SyntaxTreeSerializationByteTree',
419419
'source.syntaxtree.serialization.format.bytetree'),
420420
]

utils/gyb_syntax_support/AttributeNodes.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
Node('NonEmptyTokenList', kind='SyntaxCollection',
1111
element='Token', omit_when_empty=True),
1212

13-
# attribute -> '@' identifier '('?
14-
# ( identifier
15-
# | string-literal
13+
# attribute -> '@' identifier '('?
14+
# ( identifier
15+
# | string-literal
1616
# | integer-literal
1717
# | availability-spec-list
1818
# | specialize-attr-spec-list
@@ -24,7 +24,7 @@
2424
An `@` attribute.
2525
''',
2626
children=[
27-
Child('AtSignToken', kind='AtSignToken',
27+
Child('AtSignToken', kind='AtSignToken',
2828
description='The `@` sign.'),
2929
Child('AttributeName', kind='Token', classification='Attribute',
3030
description='The name of the attribute.'),
@@ -38,10 +38,10 @@
3838
Child('String', kind='StringLiteralToken'),
3939
Child('Integer', kind='IntegerLiteralToken'),
4040
Child('Availability', kind='AvailabilitySpecList'),
41-
Child('SpecializeArguments',
41+
Child('SpecializeArguments',
4242
kind='SpecializeAttributeSpecList'),
4343
Child('ObjCName', kind='ObjCSelector'),
44-
Child('ImplementsArguments',
44+
Child('ImplementsArguments',
4545
kind='ImplementsAttributeArguments'),
4646
Child('NamedAttributeString',
4747
kind='NamedAttributeStringArgument'),
@@ -64,9 +64,9 @@
6464
element='Attribute'),
6565

6666
# The argument of '@_specialize(...)'
67-
# specialize-attr-spec-list -> labeled-specialize-entry
67+
# specialize-attr-spec-list -> labeled-specialize-entry
6868
# specialize-spec-attr-list?
69-
# | generic-where-clause
69+
# | generic-where-clause
7070
# specialize-spec-attr-list?
7171
Node('SpecializeAttributeSpecList', kind='SyntaxCollection',
7272
description='''
@@ -87,11 +87,11 @@
8787
''',
8888
traits=['WithTrailingComma'],
8989
children=[
90-
Child('Label', kind='IdentifierToken',
90+
Child('Label', kind='IdentifierToken',
9191
description='The label of the argument'),
92-
Child('Colon', kind='ColonToken',
92+
Child('Colon', kind='ColonToken',
9393
description='The colon separating the label and the value'),
94-
Child('Value', kind='Token',
94+
Child('Value', kind='Token',
9595
description='The value for this argument'),
9696
Child('TrailingComma', kind='CommaToken',
9797
is_optional=True, description='''
@@ -131,7 +131,7 @@
131131
'''),
132132
]),
133133
# The argument of '@_implements(...)'
134-
# implements-attr-arguments -> simple-type-identifier ','
134+
# implements-attr-arguments -> simple-type-identifier ','
135135
# (identifier | operator) decl-name-arguments
136136
Node('ImplementsAttributeArguments', kind='Syntax',
137137
description='''
@@ -143,7 +143,7 @@
143143
The type for which the method with this attribute \
144144
implements a requirement.
145145
'''),
146-
Child('Comma', kind='CommaToken',
146+
Child('Comma', kind='CommaToken',
147147
description='''
148148
The comma separating the type and method name
149149
'''),
@@ -154,7 +154,7 @@
154154
Child('Identifier', kind='IdentifierToken'),
155155
Child('Operator', kind='PrefixOperatorToken'),
156156
]),
157-
Child('DeclNameArguments', kind='DeclNameArguments',
157+
Child('DeclNameArguments', kind='DeclNameArguments',
158158
is_optional=True, description='''
159159
The argument labels of the protocol\'s requirement if it \
160160
is a function requirement.

utils/gyb_syntax_support/AvailabilityNodes.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
AVAILABILITY_NODES = [
55
# availability-spec-list -> availability-entry availability-spec-list?
6-
Node('AvailabilitySpecList', kind='SyntaxCollection',
6+
Node('AvailabilitySpecList', kind='SyntaxCollection',
77
element='AvailabilityArgument'),
88

99
# Wrapper for all the different entries that may occur inside @available
10-
# availability-entry -> '*' ','?
10+
# availability-entry -> '*' ','?
1111
# | identifier ','?
1212
# | availability-version-restriction ','?
1313
# | availability-versioned-argument ','?
@@ -22,11 +22,11 @@
2222
node_choices=[
2323
Child('Star', kind='SpacedBinaryOperatorToken',
2424
text_choices=['*']),
25-
Child('IdentifierRestriction',
25+
Child('IdentifierRestriction',
2626
kind='IdentifierToken'),
27-
Child('AvailabilityVersionRestriction',
27+
Child('AvailabilityVersionRestriction',
2828
kind='AvailabilityVersionRestriction'),
29-
Child('AvailabilityLabeledArgument',
29+
Child('AvailabilityLabeledArgument',
3030
kind='AvailabilityLabeledArgument'),
3131
]),
3232
Child('TrailingComma', kind='CommaToken', is_optional=True,
@@ -44,9 +44,9 @@
4444
a value, e.g. `message: "This has been deprecated"`.
4545
''',
4646
children=[
47-
Child('Label', kind='IdentifierToken',
47+
Child('Label', kind='IdentifierToken',
4848
description='The label of the argument'),
49-
Child('Colon', kind='ColonToken',
49+
Child('Colon', kind='ColonToken',
5050
description='The colon separating label and value'),
5151
Child('Value', kind='Syntax',
5252
node_choices=[
@@ -63,7 +63,7 @@
6363
certain platform to a version, e.g. `iOS 10` or `swift 3.4`.
6464
''',
6565
children=[
66-
Child('Platform', kind='IdentifierToken',
66+
Child('Platform', kind='IdentifierToken',
6767
classification='Keyword',
6868
description='''
6969
The name of the OS on which the availability should be \
@@ -73,8 +73,8 @@
7373
Child('Version', kind='VersionTuple'),
7474
]),
7575

76-
# version-tuple -> integer-literal
77-
# | float-literal
76+
# version-tuple -> integer-literal
77+
# | float-literal
7878
# | float-literal '.' integer-literal
7979
Node('VersionTuple', kind='Syntax',
8080
description='''
@@ -98,7 +98,7 @@
9898
If the version contains a patch number, the period \
9999
separating the minor from the patch number.
100100
'''),
101-
Child('PatchVersion', kind='IntegerLiteralToken',
101+
Child('PatchVersion', kind='IntegerLiteralToken',
102102
is_optional=True, description='''
103103
The patch version if specified.
104104
'''),

utils/gyb_syntax_support/Classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from Node import error
2-
from kinds import lowercase_first_word
2+
from kinds import lowercase_first_word # noqa: I201
33

44

55
class SyntaxClassification(object):

utils/gyb_syntax_support/ExprNodes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@
473473
traits=['Parenthesized'],
474474
children=[
475475
Child('Backslash', kind='BackslashToken'),
476-
Child('LeftParen', kind='LeftParenToken',
476+
Child('LeftParen', kind='LeftParenToken',
477477
classification='StringInterpolationAnchor',
478478
force_classification=True),
479479
Child('Expression', kind='Expr'),
@@ -500,17 +500,17 @@
500500
Node('KeyPathExpr', kind='Expr',
501501
children=[
502502
Child('Backslash', kind='BackslashToken'),
503-
Child('RootExpr', kind='Expr', is_optional=True,
503+
Child('RootExpr', kind='Expr', is_optional=True,
504504
node_choices=[
505505
Child('IdentifierExpr', kind='IdentifierExpr'),
506506
Child('SpecializeExpr', kind='SpecializeExpr')
507-
]),
507+
]),
508508
Child('Expression', kind='Expr'),
509509
]),
510510

511-
# The period in the key path serves as the base on which the
511+
# The period in the key path serves as the base on which the
512512
# right-hand-side of the key path is evaluated
513-
Node('KeyPathBaseExpr', kind='Expr',
513+
Node('KeyPathBaseExpr', kind='Expr',
514514
children=[
515515
Child('Period', kind='PeriodToken'),
516516
]),

utils/gyb_syntax_support/Node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def is_buildable(self):
7878

7979
def shall_be_omitted_when_empty(self):
8080
"""
81-
Returns 'True' if this node shall not be created while parsing if it
81+
Returns 'True' if this node shall not be created while parsing if it
8282
has no children.
8383
"""
8484
return self.omit_when_empty

0 commit comments

Comments
 (0)