Commit Graph

24 Commits

Author SHA1 Message Date
Brian Gesiak c9000af795 Merge pull request #1526 from practicalswift/fix-pep8-violations-ii
[Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
2016-03-08 23:55:46 -05:00
practicalswift faf6614d60 [Python] Fix AttributeError: CalledProcessError.strerror does not exist 2016-03-08 16:02:53 +01:00
practicalswift 183da818df [Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
* E101: indentation contains mixed spaces and tabs
* E111: indentation is not a multiple of four
* E128: continuation line under-indented for visual indent
* E302: expected 2 blank lines, found 1
* W191: indentation contains tabs
2016-03-07 22:36:23 +01:00
practicalswift 679f1853d2 PEP8: Fix all violations of type "at least two spaces before inline comment" (E261) 2016-01-24 10:10:55 +01:00
practicalswift 1cd4d4e9c9 [gardening] Fix violations of non-controversial PEP8 rules
Fixes:
* multiple statements on one line (colon) (E701)
* missing whitespace around arithmetic operator (E226)
* missing whitespace around operator (E225)
* closing bracket does not match visual indentation (E124)
* blank line contains whitespace (W293)
* continuation line missing indentation or outdented (E122)
* continuation line over-indented for hanging indent (E126)
* missing expected blank line (E301)
* trailing whitespace (W291)
* unexpected spaces around keyword / parameter equals (E251)
* whitespace after '(', '[' or '{' (E201)
* whitespace before ')', ']' or '}' (E202)
* whitespace before ',' or ':' (E203)
2016-01-23 09:23:33 +01:00
Zach Panzarino e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Dmitri Gribenko 259fb78e48 SwiftBuildSupport.py: Python 3 compatibility fixes
This change allows me to get `update-checkout` and `build-script`
running with Python 3.
2015-12-25 10:38:46 +02:00
Brian Gesiak a45a4260d8 [python] Use PEP-0008 compliant code headers
Running the Python style guide checker
[`pep8`](https://pypi.python.org/pypi/pep8) on the Python code headers
in this repository results in the following error being emitted:

    $ pep8 utils/build-script
    utils/build-script:1:1: E265 block comment should start with '# '
    utils/build-script:3:1: E266 too many leading '#' for block comment
    utils/build-script:5:1: E266 too many leading '#' for block comment
    utils/build-script:6:1: E266 too many leading '#' for block comment
    utils/build-script:8:1: E266 too many leading '#' for block comment
    utils/build-script:9:1: E266 too many leading '#' for block comment
    utils/build-script:11:1: E265 block comment should start with '# '
    utils/build-script:11:80: E501 line too long (80 > 79 characters)

The problem is that the code header used in most Python files in the
repository:

1. Do not place a space in between `#` and the rest of the comment.
2. Contains some lines that just barely exceed the recommend length
   limit.

In addition, not all code headers in the repository follow the same
template.

This commit moves all Python code headers to the following template:

    # subfolder/file_name.py - Very brief description -*- python -*--
    #
    # This source file is part of the Swift.org open source project
    #
    # Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
    # Licensed under Apache License v2.0 with Runtime Library Exception
    #
    # See http://swift.org/LICENSE.txt for license information
    # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
    #
    # -----------------------------------------------------------------------------
    #
    # This file contains stuff that I am describing here in the header and will
    # be sure to keep up to date.
    #
    # ----------------------------------------------------------------------------
2015-12-24 11:35:53 -05:00
Brian Gesiak b34a83fe1c [build-script] Remove unused Python helper
Grepping this repository for `bad_usage` turns up zero results. This
function is unused.
2015-12-23 16:13:03 -05:00
practicalswift 2ce3b2bba1 Adjust the indentation of continuation line as requested by @gribozavr in #655 2015-12-21 10:24:48 +01:00
practicalswift b75f2841ae Remove redundant backslashes. 2015-12-21 10:24:09 +01:00
Brad Erickson 6af7a0e0e7 [utils] Provide error message for missing build preset options
Adds a try/catch block to utils/SwiftBuildSupport.py to catch
ConfigParser.InterpolationMissingOptionError exceptions caused by
missing required preset options. Stores all missing options to
print before exit(1) in get_preset_options().
2015-12-05 20:51:53 -08:00
Jordan Rose e564e70996 [build-script] Put back HOME global.
We don't use it in this file, but we do elsewhere!

Swift SVN r24608
2015-01-21 20:33:45 +00:00
Jordan Rose f0e21729a2 [build-script] Remove SWIFT_SOURCE_ROOT default to ~/src/s/.
This default would never actually be used, because if you did check out your
Swift sources there it would look like a normal Swift checkout and we would
infer SWIFT_SOURCE_ROOT from that.

Also, clean up some comments based on suggestions from Dave.

Swift SVN r24606
2015-01-21 19:46:14 +00:00
Dmitri Hrybenko d08cf39271 build-script: some buildbot environments don't set $HOME, so don't try
to unconditionally query it

Swift SVN r24373
2015-01-12 21:33:13 +00:00
Dmitri Hrybenko 5c76bdfd38 SwiftBuildSupport: move WorkingDirectory class to the module so that it
is reusable

Swift SVN r24268
2015-01-08 04:47:37 +00:00
Dmitri Hrybenko e889627fb0 SwiftBuildSupport: optionally print the command to be executed
Swift SVN r24267
2015-01-08 04:47:32 +00:00
Jordan Rose 5f766b07ca [build-script] Change the default SWIFT_SOURCE_ROOT and SWIFT_BUILD_ROOT.
SWIFT_SOURCE_ROOT is now auto-detected from the location of the build script
files. It looks for the following layouts:

$SWIFT_SOURCE_ROOT/<LLVM_CHECKOUT>/tools/<SWIFT_CHECKOUT>/utils/build-script
$SWIFT_SOURCE_ROOT/<SWIFT_CHECKOUT>/utils/build-script

and defaults back to ~/src/s (as before) if neither of those matches.

SWIFT_BUILD_ROOT now defaults to $SWIFT_SOURCE_ROOT/build, rather than
~/build/swift.

Swift SVN r24194
2015-01-05 23:58:57 +00:00
Jordan Rose 7dea958826 [build-script] Add a --show-presets option.
This isn't really doing anything more than just looking at the preset files,
but we might as well have it.

Swift SVN r24193
2015-01-05 23:58:57 +00:00
Jordan Rose d5ce4e40fd [build-script] Underscore-prefix a helper function.
Per Python style, module-private functions should be prefixed with
underscores so that they are not made available to importers.

Swift SVN r24192
2015-01-05 23:58:53 +00:00
Dmitri Hrybenko 92f9f6308d build-script: stringify the exit code before applying string
concatenation

Swift SVN r24171
2015-01-05 07:17:53 +00:00
Dmitri Hrybenko cc02f264a9 build-script: refactor to use uniform error reporting
Swift SVN r24168
2015-01-02 22:53:08 +00:00
Dmitri Hrybenko 49a510a8af SwiftBuildSupport.py: fix typo in error message
Swift SVN r24153
2014-12-26 10:44:00 +00:00
Dmitri Hrybenko 6670bb76ec Rewrite the CMake build system
Swift SVN r24124
2014-12-23 22:15:30 +00:00