Skip to content

Commit 679f185

Browse files
PEP8: Fix all violations of type "at least two spaces before inline comment" (E261)
1 parent d021aed commit 679f185

File tree

10 files changed

+41
-21
lines changed

10 files changed

+41
-21
lines changed

test/Driver/Dependencies/Inputs/touch.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
assert len(sys.argv) >= 2
2222
timeVal = int(sys.argv[1])
2323

24-
timeVal += 946684800 # offset between Unix and LLVM epochs
24+
# offset between Unix and LLVM epochs
25+
timeVal += 946684800
2526

2627
# Update the output file mtime, or create it if necessary.
2728
# From http://stackoverflow.com/a/1160227.

tools/SourceKit/bindings/python/sourcekitd/capi.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,17 @@ def to_python_object(self):
226226
def to_python_array(self):
227227
def applier(index, value, arr):
228228
arr.append(value.to_python_object())
229-
return 1 # continue
229+
# continue
230+
return 1
230231
arr = []
231232
conf.lib.sourcekitd_variant_array_apply_f(self, callbacks['array_applier'](applier), arr)
232233
return arr
233234

234235
def to_python_dictionary(self):
235236
def applier(cobj, value, d):
236237
d[str(UIdent(cobj))] = value.to_python_object()
237-
return 1 # continue
238+
# continue
239+
return 1
238240
d = {}
239241
conf.lib.sourcekitd_variant_dictionary_apply_f(self, callbacks['dictionary_applier'](applier), d)
240242
return d
@@ -297,7 +299,7 @@ def __repr__(self):
297299
functionList = [
298300
# FIXME: Fix PEP8 violation "continuation line under-indented for hanging
299301
# indent" (E121) and remove "noqa" marker.
300-
("sourcekitd_cancel_request", # noqa
302+
("sourcekitd_cancel_request", # noqa
301303
[c_void_p]),
302304

303305
("sourcekitd_initialize",

utils/SwiftBuildSupport.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
from __future__ import print_function
1212

1313
try:
14-
import ConfigParser # Python 2
14+
# Python 2
15+
import ConfigParser
1516
except ImportError:
16-
import configparser as ConfigParser # Python 3
17+
# Python 3
18+
import configparser as ConfigParser
1719

1820
import os
1921
import pipes

utils/SwiftIntTypes.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def all_integer_type_names():
7878
return [self_ty.stdlib_name for self_ty in all_integer_types(0)]
7979

8080
def all_real_number_type_names():
81-
return ['Float', 'Double'] # FIXME , 'Float80' Revert until I figure out a test failure # Float80 for i386 & x86_64
81+
# FIXME , 'Float80' Revert until I figure out a test failure # Float80 for i386 & x86_64
82+
return ['Float', 'Double']
8283

8384
def all_numeric_type_names():
8485
return all_integer_type_names() + all_real_number_type_names()

utils/gyb.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ def tokenizeTemplate(templateText):
231231
if kind in ('literal', 'symbol'):
232232
if len(savedLiteral) == 0:
233233
literalFirstMatch = m
234-
savedLiteral.append(text) # literals and symbols get batched together
234+
# literals and symbols get batched together
235+
savedLiteral.append(text)
235236
pos = None
236237
else:
237238
# found a non-literal. First yield any literal we've accumulated
@@ -248,7 +249,8 @@ def tokenizeTemplate(templateText):
248249
if pos is None:
249250
pos = m.end(0)
250251
else:
251-
yield # Client is not yet ready to process next token
252+
# Client is not yet ready to process next token
253+
yield
252254

253255
if savedLiteral != []:
254256
yield 'literal', ''.join(savedLiteral), literalFirstMatch
@@ -328,7 +330,8 @@ def splitGybLines(sourceLines):
328330
lastTokenText, lastTokenKind = tokenText, tokenKind
329331

330332
except tokenize.TokenError:
331-
return [] # Let the later compile() call report the error
333+
# Let the later compile() call report the error
334+
return []
332335

333336
if lastTokenText == ':':
334337
unmatchedIndents.append(len(sourceLines))
@@ -459,7 +462,8 @@ def tokenGenerator(self, baseTokens):
459462
# Do we need to close the current lines?
460463
self.closeLines = kind == 'gybLinesClose'
461464

462-
if kind.endswith('Open'): # %{...}% and ${...} constructs
465+
# %{...}% and ${...} constructs
466+
if kind.endswith('Open'):
463467

464468
# Tokenize text that follows as Python up to an unmatched '}'
465469
codeStart = self.tokenMatch.end(kind)
@@ -478,7 +482,8 @@ def tokenGenerator(self, baseTokens):
478482
nextPos = m2.end(0)
479483
else:
480484
assert kind == 'substitutionOpen'
481-
nextPos = closePos + 1 # skip past the closing '}'
485+
# skip past the closing '}'
486+
nextPos = closePos + 1
482487

483488
# Resume tokenizing after the end of the code.
484489
baseTokens.send(nextPos)

utils/name-compression/CBCGen.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def addLine(line):
104104

105105
# notice that Y and J are missing because they are escape chars:
106106
charset = r"0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIKLMNOPQRSTUVWXZ$"
107-
encoders = [c for c in charset] # alphabet without the escape chars.
107+
# alphabet without the escape chars.
108+
encoders = [c for c in charset]
108109
enc_len = len(encoders)
109110

110111
# Take the most frequent entries from the table that fit into the range of

utils/name-compression/HuffGen.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ def addLine(line):
3131
class Node:
3232
""" This is a node in the Huffman tree """
3333
def __init__(self, hits, value=None, l=None, r=None):
34-
self.hit = hits # Number of occurrences for this node.
35-
self.left = l # Left subtree.
36-
self.right = r # Right subtree.
37-
self.val = value # Character value for leaf nodes.
34+
# Number of occurrences for this node.
35+
self.hit = hits
36+
# Left subtree.
37+
self.left = l
38+
# Right subtree.
39+
self.right = r
40+
# Character value for leaf nodes.
41+
self.val = value
3842

3943
def merge(Left, Right):
4044
""" This is the merge phase of the huffman encoding algorithm

utils/pass-pipeline/src/pass_pipeline_library.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def ssapass_passlist(optlevel):
7878
p.SILCombine,
7979
simplifycfg_silcombine_passlist(),
8080
p.GlobalLoadStoreOpts,
81-
p.CodeMotion, # Need to add proper argument here
81+
# Need to add proper argument here
82+
p.CodeMotion,
8283
p.GlobalARCOpts,
8384
p.SpeculativeDevirtualizer,
8485
p.SILLinker,

utils/protocol_graph.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ def parseProtocol(m):
134134

135135
# Find clusters of protocols that have the same name when underscores
136136
# are stripped
137-
clusterBuilder = {} # map from potential cluster name to nodes in the cluster
137+
# map from potential cluster name to nodes in the cluster
138+
clusterBuilder = {}
138139
for n in graph:
139140
clusterBuilder.setdefault(n.translate(None, '_'), set()).add(n)
140141

@@ -148,7 +149,8 @@ def parseProtocol(m):
148149
for t in graph[s] if t in elements)
149150

150151
print('digraph ProtocolHierarchies {')
151-
print(' mclimit = 100; ranksep=1.5; ') # ; packmode="array1"
152+
# ; packmode="array1"
153+
print(' mclimit = 100; ranksep=1.5; ')
152154
print(' edge [dir="back"];')
153155
print(' node [shape = box, fontname = Helvetica, fontsize = 10];')
154156

utils/swift-bench.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ def computeItersNumber(self, name):
259259
r = self.runCommand([self.tests[name].binary, str(scale),
260260
self.tests[name].name])
261261
(testName, itersComputed, execTime) = self.parseBenchmarkOutput(r)
262-
spent = int(execTime) / 1000000 # Convert ns to ms
262+
# Convert ns to ms
263+
spent = int(execTime) / 1000000
263264
if spent <= self.minIterTime:
264265
scale *= 2
265266
if scale > sys.maxint:

0 commit comments

Comments
 (0)