GitHub user Stibbons opened a pull request:

    https://github.com/apache/spark/pull/14567

    Python import reorg

    ## What changes were proposed in this pull request?
    
    This patch adds a code style validation script following pep8 
recommendations.
    
    Features:
    - add a .editconfig file (Scala files use 2 space indentation, while Python 
uses 4) for compatible editors (almost every editors has a plugin to support 
.editconfig file)
    - use autopep8 to fix basic pep8 mistakes
    - use isort to automatically split "import" statement and organise them 
into logically linked order (see doc 
[here](https://pypi.python.org/pypi/isort#multi-line-output-modes). The most 
important thing is that it split import statements that imports more than one 
object into several lines. This will increase the number of line of the file, 
but this facilitates a lot file maintainance and file merges if needed.
    - add a 'validate.sh' script in order to automatise the correction (need 
isort and autopep8 installed)
    
    You can see similar script in prod in the 
[Buildbot](https://github.com/buildbot/buildbot/blob/master/common/validate.sh) 
project
    
    
    ## How was this patch tested?
    
    Simple tests on my machines has been done (local mode only). There should 
not have any regression or feature change at all with this pull request.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Stibbons/spark python_import_reorg

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/14567.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #14567
    
----
commit 61d6f38470ded699d0a0a751a79f069f1bf66cb1
Author: Gaetan Semet <[email protected]>
Date:   2016-08-09T16:13:55Z

    reorg python imports statements

commit 2b719bec3e286e60d5f4f895e9d044c0f6ac0b84
Author: Gaetan Semet <[email protected]>
Date:   2016-08-09T16:13:20Z

    autopep8

commit 97540d727679cc72ce13368f56c69ec412b6f162
Author: Gaetan Semet <[email protected]>
Date:   2016-08-09T16:14:10Z

    import isort

commit 85a56ec22f4d2829242b0f1a9491bae7d117c18e
Author: Gaetan Semet <[email protected]>
Date:   2016-08-09T16:35:39Z

    validate script

commit 84320dd6ba6c7d6c367d422423d2f5c1a95c6f82
Author: Gaetan Semet <[email protected]>
Date:   2016-08-09T16:36:00Z

    isort execution

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to