diff --git a/.pep8 b/.pep8 index 5c9a43a5399d3..70cce09fa442b 100644 --- a/.pep8 +++ b/.pep8 @@ -1,3 +1,2 @@ [flake8] filename = *.py,Benchmark_Driver,Benchmark_DTrace.in,Benchmark_GuardMalloc.in,Benchmark_RuntimeLeaksRunner.in,build-script,gyb,line-directive,ns-html2rst,recursive-lipo,rth,submit-benchmark-results,update-checkout,viewcfg -max-line-length = 80 diff --git a/benchmark/scripts/Benchmark_DTrace.in b/benchmark/scripts/Benchmark_DTrace.in index 4cbd1702d26ae..8f78fee9b33e4 100644 --- a/benchmark/scripts/Benchmark_DTrace.in +++ b/benchmark/scripts/Benchmark_DTrace.in @@ -1,6 +1,6 @@ #!/usr/bin/env python -# ===--- Benchmark_DTrace.in ----------------------------------------------===// +# ===--- Benchmark_DTrace.in ---------------------------------------------===// # # This source file is part of the Swift.org open source project # @@ -10,7 +10,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors # -# ===----------------------------------------------------------------------===// +# ===---------------------------------------------------------------------===// import argparse import os diff --git a/benchmark/scripts/Benchmark_Driver b/benchmark/scripts/Benchmark_Driver index bbf4ef72bccfe..aad5f533ace57 100755 --- a/benchmark/scripts/Benchmark_Driver +++ b/benchmark/scripts/Benchmark_Driver @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# ===--- Benchmark_Driver -------------------------------------------------===// +# ===--- Benchmark_Driver ------------------------------------------------===// # # This source file is part of the Swift.org open source project # @@ -11,7 +11,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors # -# ===----------------------------------------------------------------------===// +# ===---------------------------------------------------------------------===// import argparse import datetime @@ -109,10 +109,10 @@ def instrument_test(driver_path, test, num_samples): avg_test_output[i] = int(round(avg_test_output[i] / float(len(test_outputs)))) avg_test_output[num_samples_index] = num_samples - avg_test_output[min_index] = min(test_outputs, - key=lambda x: int(x[min_index]))[min_index] - avg_test_output[max_index] = max(test_outputs, - key=lambda x: int(x[max_index]))[max_index] + avg_test_output[min_index] = min( + test_outputs, key=lambda x: int(x[min_index]))[min_index] + avg_test_output[max_index] = max( + test_outputs, key=lambda x: int(x[max_index]))[max_index] avg_test_output = map(str, avg_test_output) return avg_test_output diff --git a/benchmark/scripts/Benchmark_GuardMalloc.in b/benchmark/scripts/Benchmark_GuardMalloc.in index 2e6cb600745d7..1b03e132de9c5 100644 --- a/benchmark/scripts/Benchmark_GuardMalloc.in +++ b/benchmark/scripts/Benchmark_GuardMalloc.in @@ -1,6 +1,6 @@ #!/usr/bin/env python -# ===--- Benchmark_GuardMalloc.in -----------------------------------------===// +# ===--- Benchmark_GuardMalloc.in ----------------------------------------===// # # This source file is part of the Swift.org open source project # @@ -10,7 +10,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors # -# ===----------------------------------------------------------------------===// +# ===---------------------------------------------------------------------===// import os import subprocess diff --git a/benchmark/scripts/Benchmark_RuntimeLeaksRunner.in b/benchmark/scripts/Benchmark_RuntimeLeaksRunner.in index 0acb0f8d13da5..15f4ac084cf83 100644 --- a/benchmark/scripts/Benchmark_RuntimeLeaksRunner.in +++ b/benchmark/scripts/Benchmark_RuntimeLeaksRunner.in @@ -1,6 +1,6 @@ #!/usr/bin/env python -# ===--- Benchmark_RuntimeLeaksRunner.in ----------------------------------===// +# ===--- Benchmark_RuntimeLeaksRunner.in ---------------------------------===// # # This source file is part of the Swift.org open source project # @@ -10,7 +10,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors # -# ===----------------------------------------------------------------------===// +# ===---------------------------------------------------------------------===// import json import os @@ -26,8 +26,8 @@ import perf_test_driver # noqa (E402 module level import not at top of file) XFAIL_LIST = [ ] -# Global objective-c classes created by various frameworks. We do not care about -# these. +# Global objective-c classes created by various frameworks. We do not care +# about these. IGNORABLE_GLOBAL_OBJC_CLASSES = set([ '__NSPlaceholderDate', 'NSCache', diff --git a/benchmark/scripts/compare_perf_tests.py b/benchmark/scripts/compare_perf_tests.py index 6b740cda5106b..bc9940db560e9 100755 --- a/benchmark/scripts/compare_perf_tests.py +++ b/benchmark/scripts/compare_perf_tests.py @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# ===--- compare_perf_tests.py --------------------------------------------===// +# ===--- compare_perf_tests.py -------------------------------------------===// # # This source file is part of the Swift.org open source project # @@ -11,7 +11,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors # -# ===----------------------------------------------------------------------===// +# ===---------------------------------------------------------------------===// # e.g. # repeat.sh 3 tot/bin/Benchmark_Driver run -o -O > tot.O.times @@ -136,7 +136,8 @@ def compare_scores(key, score1, worstsample1, score2, worstsample2, runs, num): if bestscore1 != 0 and bestscore2 != 0: print(("%+.1f%%" % - (((float(bestscore2) / bestscore1) - 1) * 100)).rjust(9), end="") + (((float(bestscore2) / bestscore1) - 1) * 100)).rjust(9), + end="") if ShowSpeedup: Num, Den = float(bestscore2), float(bestscore1) if IsTime: diff --git a/benchmark/scripts/generate_harness/generate_harness.py b/benchmark/scripts/generate_harness/generate_harness.py index e44056b466b6d..a4c7a0a52f7f1 100644 --- a/benchmark/scripts/generate_harness/generate_harness.py +++ b/benchmark/scripts/generate_harness/generate_harness.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# ===--- generate_harness.py ----------------------------------------------===// +# ===--- generate_harness.py ---------------------------------------------===// # # This source file is part of the Swift.org open source project # @@ -10,7 +10,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors # -# ===----------------------------------------------------------------------===// +# ===---------------------------------------------------------------------===// # Generate CMakeLists.txt and utils/main.swift from templates. diff --git a/benchmark/scripts/perf_test_driver/perf_test_driver.py b/benchmark/scripts/perf_test_driver/perf_test_driver.py index 27f0701333461..5e9e3b115c0a2 100644 --- a/benchmark/scripts/perf_test_driver/perf_test_driver.py +++ b/benchmark/scripts/perf_test_driver/perf_test_driver.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# ===--- perf_test_driver.py ----------------------------------------------===// +# ===--- perf_test_driver.py ---------------------------------------------===// # # This source file is part of the Swift.org open source project # @@ -10,7 +10,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors # -# ===----------------------------------------------------------------------===// +# ===---------------------------------------------------------------------===// import multiprocessing import os diff --git a/benchmark/utils/convertToJSON.py b/benchmark/utils/convertToJSON.py index 468df2717626b..e5f9053df3828 100644 --- a/benchmark/utils/convertToJSON.py +++ b/benchmark/utils/convertToJSON.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# ===--- convertToJSON.py -------------------------------------------------===// +# ===--- convertToJSON.py ------------------------------------------------===// # # This source file is part of the Swift.org open source project # @@ -10,7 +10,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors # -# ===----------------------------------------------------------------------===// +# ===---------------------------------------------------------------------===// # This script converts results from pre-commit benchmark tests to JSON. # Usage: PrecommitBench_O | convertToJSON.py diff --git a/docs/conf.py b/docs/conf.py index 47da3583a71d1..5769c1c66f54a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,7 +2,8 @@ # # Swift documentation build configuration file. # -# This file is execfile()d with the current directory set to its containing dir. +# This file is execfile()d with the current directory set to its containing +# dir. # # Note that not all possible configuration values are present in this # autogenerated file. @@ -23,8 +24,8 @@ # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.0' -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo'] # Add any paths that contain templates here, relative to this directory. @@ -66,7 +67,8 @@ # directories to ignore when looking for source files. exclude_patterns = ['_build'] -# The reST default role (used for this markup: `text`) to use for all documents. +# The reST default role (used for this markup: `text`) to use for all +# documents. # default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. @@ -190,7 +192,8 @@ } # Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). +# (source start file, target name, title, author, documentclass +# [howto/manual]). latex_documents = [ ('contents', 'Swift.tex', u'Swift Documentation', u'LLVM project', 'manual'), diff --git a/utils/GYBUnicodeDataUtils.py b/utils/GYBUnicodeDataUtils.py index 7f1c38b30b876..9fd14857dfe56 100644 --- a/utils/GYBUnicodeDataUtils.py +++ b/utils/GYBUnicodeDataUtils.py @@ -1,4 +1,4 @@ -# ===--- GYBUnicodeDataUtils.py -----------------------*- coding: utf-8 -*-===// +# ===--- GYBUnicodeDataUtils.py ----------------------*- coding: utf-8 -*-===// # # This source file is part of the Swift.org open source project # @@ -105,8 +105,8 @@ def __init__(self, grapheme_break_property_file_name): for cp in range(0, 0x110000): self.property_values[cp] = self.get_default_value() - for start_code_point, end_code_point, val in self.property_value_ranges: - for cp in range(start_code_point, end_code_point + 1): + for start_code_pt, end_code_pt, val in self.property_value_ranges: + for cp in range(start_code_pt, end_code_pt + 1): self.property_values[cp] = val def get_default_value(self): @@ -320,7 +320,8 @@ def get_value(self, cp): if cp <= 0xffff: data_block_index = self.bmp_lookup[ self.get_bmp_first_level_index(cp)] - return self.bmp_data[data_block_index][self.get_bmp_data_offset(cp)] + return self.bmp_data[data_block_index][ + self.get_bmp_data_offset(cp)] else: second_lookup_index = self.supp_lookup1[ self.get_supp_first_level_index(cp)] @@ -552,14 +553,14 @@ def _convert_line(line): pass else: code_point = int(token, 16) - # Tests from Unicode spec have isolated surrogates in them. Our - # segmentation algorithm works on UTF-8 sequences, so encoding a - # surrogate would produce an invalid code unit sequence. - # Instead of trying to emulate the maximal subpart algorithm for - # inserting U+FFFD in Python, we just replace every isolated - # surrogate with U+200B, which also has Grapheme_Cluster_Break - # equal to 'Control' and test separately that we handle - # ill-formed UTF-8 sequences. + # Tests from Unicode spec have isolated surrogates in them. + # Our segmentation algorithm works on UTF-8 sequences, so + # encoding a surrogate would produce an invalid code unit + # sequence. Instead of trying to emulate the maximal subpart + # algorithm for inserting U+FFFD in Python, we just replace + # every isolated surrogate with U+200B, which also has + # Grapheme_Cluster_Break equal to 'Control' and test + # separately that we handle ill-formed UTF-8 sequences. if code_point >= 0xd800 and code_point <= 0xdfff: code_point = 0x200b code_point = (b'\U%(cp)08x' % {b'cp': code_point}).decode( @@ -613,14 +614,14 @@ def _convert_line(line): pass else: code_point = int(token, 16) - # Tests from Unicode spec have isolated surrogates in them. Our + # Tests from Unicode spec have isolated surrogates in them. Our # segmentation algorithm works on UTF-16 sequences, so encoding # a surrogate would produce an invalid code unit sequence. - # Instead of trying to emulate the maximal subpart algorithm for - # inserting U+FFFD in Python, we just replace every isolated - # surrogate with U+200B, which also has Grapheme_Cluster_Break - # equal to 'Control' and test separately that we handle - # ill-formed UTF-8 sequences. + # Instead of trying to emulate the maximal subpart algorithm + # for inserting U+FFFD in Python, we just replace every + # isolated surrogate with U+200B, which also has + # Grapheme_Cluster_Break equal to 'Control' and test separately + # that we handle ill-formed UTF-8 sequences. if code_point >= 0xd800 and code_point <= 0xdfff: code_point = 0x200b test += [code_point] diff --git a/utils/SwiftIntTypes.py b/utils/SwiftIntTypes.py index 2641715c3d7b2..10c034f08bf69 100644 --- a/utils/SwiftIntTypes.py +++ b/utils/SwiftIntTypes.py @@ -1,4 +1,4 @@ -# ===--- SwiftIntTypes.py -----------------------------*- coding: utf-8 -*-===// +# ===--- SwiftIntTypes.py ----------------------------*- coding: utf-8 -*-===// # # This source file is part of the Swift.org open source project # diff --git a/utils/build-script b/utils/build-script index 6ca08689c7ac1..858ada5ab9ea8 100755 --- a/utils/build-script +++ b/utils/build-script @@ -284,7 +284,8 @@ To use it, specify the '--preset=' argument: [~/src/s]$ ./swift/utils/build-script --preset=ds ./swift/utils/build-script: using preset 'ds', which expands to - ./swift/utils/build-script --release --debug-swift --debug-swift-stdlib --test + ./swift/utils/build-script --release --debug-swift --debug-swift-stdlib \ + --test --build-subdir=ds -- ... diff --git a/utils/cmpcodesize/cmpcodesize/compare.py b/utils/cmpcodesize/cmpcodesize/compare.py index ee4a35da6844b..5395767ad114a 100644 --- a/utils/cmpcodesize/cmpcodesize/compare.py +++ b/utils/cmpcodesize/cmpcodesize/compare.py @@ -1,4 +1,4 @@ -# ====--- compare.py - Compare built products' sizes --*- coding: utf-8 -*-===// +# ====--- compare.py - Compare built products' sizes -*- coding: utf-8 -*-===// # # This source file is part of the Swift.org open source project # diff --git a/utils/cmpcodesize/cmpcodesize/main.py b/utils/cmpcodesize/cmpcodesize/main.py index 94a5eb9c02dd5..77aa9fc366b37 100644 --- a/utils/cmpcodesize/cmpcodesize/main.py +++ b/utils/cmpcodesize/cmpcodesize/main.py @@ -38,9 +38,9 @@ def main(): Environment variables: SWIFT_NEW_BUILDDIR The new build-dir -E.g. $HOME/swiftnew/build/Ninja-ReleaseAssert+stdlib-Release/swift-macosx-x86_64 +E.g. .../swiftnew/build/Ninja-ReleaseAssert+stdlib-Release/swift-macosx-x86_64 SWIFT_OLD_BUILDDIR The old build-dir -E.g. $HOME/swiftold/build/Ninja-ReleaseAssert+stdlib-Release/swift-macosx-x86_64 +E.g. .../swiftold/build/Ninja-ReleaseAssert+stdlib-Release/swift-macosx-x86_64 How to specify files: 1) No files: diff --git a/utils/gyb.py b/utils/gyb.py index 3a862339f0ecb..ff485ae88b66c 100755 --- a/utils/gyb.py +++ b/utils/gyb.py @@ -360,7 +360,8 @@ def code_starts_with_dedent_keyword(source_lines): False >>> code_starts_with_dedent_keyword(split_lines('except ifSomethingElse:')) True - >>> code_starts_with_dedent_keyword(split_lines('\n# comment\nelse: # yes')) + >>> code_starts_with_dedent_keyword( + split_lines('\n# comment\nelse: # yes')) True """ token_text = None @@ -449,7 +450,7 @@ def token_generator(self, base_tokens): ... '''% for x in [1, 2, 3]: ... % if x == 1: ... literal1 - ... % elif x > 1: # add an output line after this line to fix the bug + ... % elif x > 1: # add an output line after this line to fix bug ... % if x == 2: ... literal2 ... % end @@ -544,7 +545,8 @@ def next_token(self): class ExecutionContext(object): """State we pass around during execution of a template""" - def __init__(self, line_directive='// ###sourceLocation', **local_bindings): + def __init__(self, line_directive='// ###sourceLocation', + **local_bindings): self.local_bindings = local_bindings self.line_directive = line_directive self.local_bindings['__context__'] = self @@ -753,7 +755,7 @@ def parse_template(filename, text=None): { if x == 1: __children__[0].execute(__context__) - elif x > 1: # add output line after this line to fix the bug + elif x > 1: # add output line after this line to fix bug __children__[1].execute(__context__) } [ diff --git a/utils/protocol_graph.py b/utils/protocol_graph.py index 8e47c525686a6..8220257b56b69 100644 --- a/utils/protocol_graph.py +++ b/utils/protocol_graph.py @@ -1,4 +1,4 @@ -# ===--- protocol_graph.py ----------------------------*- coding: utf-8 -*-===// +# ===--- protocol_graph.py ---------------------------*- coding: utf-8 -*-===// # # This source file is part of the Swift.org open source project # @@ -8,7 +8,7 @@ # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors # -# ===----------------------------------------------------------------------===// +# ===---------------------------------------------------------------------===// # # Create a graph of the protocol refinement relationships, associated # types, operator requirements, and defaulted generic operators. @@ -21,7 +21,7 @@ # && dot -Tsvg /tmp/protocols.dot > /tmp/protocols.svg \ # && open /tmp/protocols.svg # -# ===----------------------------------------------------------------------===// +# ===---------------------------------------------------------------------===// from __future__ import print_function @@ -42,12 +42,12 @@ # Pattern to recognize a (possibly-generic) operator decl. operator = r''' (?:(?:prefix|postfix).*)? func \s* -(?=\S)[^A-Za-z_] # non-space, non-identifier: begins an operator name -(?:(?=\S)[^(){])* # rest of operator name +(?=\S)[^A-Za-z_] # non-space, non-identifier: begins an operator name +(?:(?=\S)[^(){])* # rest of operator name \s* -(<[^>{]+>)? # generic parameter list +(<[^>{]+>)? # generic parameter list \s* -\([^)]*\) # function parameter list +\([^)]*\) # function parameter list ''' # substitute local variables into the string @@ -180,7 +180,8 @@ def parse_protocol(m): requirements = body.get(node, []) generics = sorted(generic_operators.get(node, set())) style = 'solid' if node.startswith('_') else 'bold' - divider = '
\n' if len(requirements) != 0 and len(generics) != 0 else '' + divider = '
\n' if len(requirements) != 0 and len(generics) != 0 \ + else '' label = node if len(requirements + generics) == 0 else ( '\n\n
' + diff --git a/utils/pygments/swift.py b/utils/pygments/swift.py index 06d83b0152a00..0e2c3abfedd7a 100644 --- a/utils/pygments/swift.py +++ b/utils/pygments/swift.py @@ -157,7 +157,8 @@ class SwiftLexer(RegexLexer): 'class-name': [ (r'[A-Z][a-zA-Z0-9_?]*', Name.Constant), - (r'(\[)([0-9]+)(\])', bygroups(Operator, Number.Integer, Operator)), + (r'(\[)([0-9]+)(\])', + bygroups(Operator, Number.Integer, Operator)), (r'<', Punctuation, 'generic-type'), (r'\.\(', Punctuation, 'arg-list'), (r'\(', Punctuation, 'type-cast'), diff --git a/utils/recursive-lipo b/utils/recursive-lipo index 222940d074add..534c0af999e1a 100755 --- a/utils/recursive-lipo +++ b/utils/recursive-lipo @@ -44,8 +44,8 @@ def merge_lipo_files(src_root_dirs, file_list, copy_verbatim_subpaths, Any path in file_list that's a directory in src_root_dirs results in a corresponding subdirectory in dest_root_dir. If the subdirectory path - matches copy_verbatim_subpaths, the whole subdirectory is recursively copied - verbatim. + matches copy_verbatim_subpaths, the whole subdirectory is recursively + copied verbatim. """ lipo_cmd = [lipo_executable, "-create"] @@ -112,8 +112,9 @@ the file is copied directly to the destination. If there are different files in different directories, but the files are executable, lipo is run to merge the files together. Otherwise, a warning is produced. -Use --copy-subdirs to override normal logic and copy certain sub directory paths -verbatim. This is useful if some subdirectories already contain fat binaries. +Use --copy-subdirs to override normal logic and copy certain sub directory +paths verbatim. This is useful if some subdirectories already contain fat +binaries. """) parser.add_argument("-v", "--verbose", action='store_true', diff --git a/utils/submit-benchmark-results b/utils/submit-benchmark-results index ebfb3f1c47456..a7b21ce9666f2 100644 --- a/utils/submit-benchmark-results +++ b/utils/submit-benchmark-results @@ -86,7 +86,8 @@ def main(): parser.add_option("", "--output", dest="output", metavar="PATH", help="Write raw report data to PATH", action="store", type=str, default=None) - parser.add_option("", "--machine-name", dest="machine_name", metavar="NAME", + parser.add_option("", "--machine-name", dest="machine_name", + metavar="NAME", help="Set the machine name to embed in the report", action="store", type=str, default=None) parser.add_option("", "--run-order", dest="run_order", metavar="REVISION", @@ -113,8 +114,8 @@ def main(): machine_name = opts.machine_name run_order = str(opts.run_order) - # Estimate the end time as being now, and the start time as being that minus - # the elapsed testing time. + # Estimate the end time as being now, and the start time as being that + # minus the elapsed testing time. utcnow = datetime.datetime.utcnow() start_time = utcnow - datetime.timedelta(seconds=data['elapsed']) end_time = utcnow diff --git a/utils/swift-api-dump.py b/utils/swift-api-dump.py index 53b28abff0eda..b8ca9ea4aec3e 100755 --- a/utils/swift-api-dump.py +++ b/utils/swift-api-dump.py @@ -120,8 +120,9 @@ def collect_submodules(common_args, module): my_args = ['-module-print-submodules', '-module-to-print=%s' % (module)] (exitcode, out, err) = run_command(common_args + my_args) if exitcode != 0: - print('error: submodule collection failed for module %s with error %d' % - (module, exitcode)) + print( + 'error: submodule collection failed for module %s with error %d' % + (module, exitcode)) return () # Find all of the submodule imports. @@ -146,7 +147,8 @@ def print_command(cmd, outfile=""): # Dump the API for the given module. -def dump_module_api((cmd, extra_dump_args, output_dir, module, quiet, verbose)): +def dump_module_api((cmd, extra_dump_args, output_dir, module, quiet, + verbose)): # Collect the submodules submodules = collect_submodules(cmd, module) @@ -228,8 +230,9 @@ def collect_frameworks(sdk): return (sorted(list(frameworks)), sdk_path) -def create_dump_module_api_args(cmd_common, cmd_extra_args, sdk, module, target, - source_filename, output_dir, quiet, verbose): +def create_dump_module_api_args(cmd_common, cmd_extra_args, sdk, module, + target, source_filename, output_dir, quiet, + verbose): # Determine the SDK root and collect the set of frameworks. (frameworks, sdk_root) = collect_frameworks(sdk) diff --git a/utils/swift-bench.py b/utils/swift-bench.py index d0301d396fbcf..33a7bd6587e92 100644 --- a/utils/swift-bench.py +++ b/utils/swift-bench.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# ===--- swift-bench.py -------------------------------*- coding: utf-8 -*-===// +# ===--- swift-bench.py ------------------------------*- coding: utf-8 -*-===// # # This source file is part of the Swift.org open source project # @@ -16,16 +16,16 @@ # each of these functions, runs all the tests and reports aggregate results. # # The workflow of the harness is the following: -# o Basing on the input files, generate 'processed' files. These files contain -# a main function with simple arguments parsing, time measurement utilities -# and a loop in which the bench-functions are called. +# o Basing on the input files, generate 'processed' files. These files +# contain a main function with simple arguments parsing, time measurement +# utilities and a loop in which the bench-functions are called. # o When all files are processed, the harness begins to compile them, keeping # track of all compile fails for later results reporting. # o When all files are compiled, the harness begins to run the tests. The # harness chooses a number of iterations for each tests to achieve the best -# accuracy in the given time limit (in order to do that, it performs several -# auxiliary test runs). When the iteration number is chosen, the measurement -# of execution time is actually performed. +# accuracy in the given time limit (in order to do that, it performs +# several auxiliary test runs). When the iteration number is chosen, the +# measurement of execution time is actually performed. # o At this point everything is ready, and the harness simply reports the # results. # @@ -316,8 +316,8 @@ def run_bench(self, name): if (num_samples, iter_scale) == (0, 0): self.tests[name].status = "CAN'T MEASURE" self.tests[name].output = ( - "Can't find number of iterations for the test to last longer " + - "than %d ms." % self.min_iter_time) + "Can't find number of iterations for the test to last " + + "longer than %d ms." % self.min_iter_time) return samples = [] self.log("Running bench: %s, numsamples: %d" % (name, num_samples), 2) diff --git a/utils/update-checkout b/utils/update-checkout index 4323e55622fc2..147e688387486 100755 --- a/utils/update-checkout +++ b/utils/update-checkout @@ -97,7 +97,8 @@ def obtain_additional_swift_sources( repo_branch = NEXT_BRANCHES[dir_name] else: repo_branch = branch - src_path = SWIFT_SOURCE_ROOT + "/" + dir_name + "/" + ".git" + src_path = SWIFT_SOURCE_ROOT + "/" + dir_name + "/" + \ + ".git" check_call(['git', '--git-dir', src_path, '--work-tree', os.path.join(SWIFT_SOURCE_ROOT, dir_name), 'checkout', repo_branch]) diff --git a/validation-test/stdlib/Slice/Inputs/GenerateSliceTests.py b/validation-test/stdlib/Slice/Inputs/GenerateSliceTests.py index e3022fc6d91ee..885ed57bdc619 100644 --- a/validation-test/stdlib/Slice/Inputs/GenerateSliceTests.py +++ b/validation-test/stdlib/Slice/Inputs/GenerateSliceTests.py @@ -8,8 +8,8 @@ for traversal, base_kind, mutable in itertools.product(traversal_options, base_kind_options, mutable_options): - # Test Slice and MutableSlice of various collections using value - # types as elements. + # Test Slice and MutableSlice of various collections using + # value types as elements. wrapper_types = ['Slice', 'MutableSlice'] if mutable else ['Slice'] for Wrapper in wrapper_types: for name, prefix, suffix in [
\n%s\n