Introduce isort to check *.py import ordering.

Review Request #1726 — Created Feb. 6, 2015 and submitted

jsirois
pants
jsirois/pants/introduce_isort_tools
1049
91c3ce9...
pants-reviews
dturner-tw, mateor, patricklaw, zundel
This change adds build-support/bin/isort.sh and incorporates it in
build-support/bin/ci.sh. By default the script runs in check mode and
exits non-zero if there are one or more files with non-conformant import
order. The script also has a fix mode that will fixup files not in
compliance. This mode was run in this change to normalize the repo.

 .isort.cfg                                                                             | 10 +++++++
 build-support/bin/check_header.sh                                                      |  4 +--
 build-support/bin/ci.sh                                                                |  1 +
 build-support/bin/isort.sh                                                             | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++
 ...
 450 files changed, 1366 insertions(+), 1288 deletions(-)

Used the script to create most of the changes in this review: ./build-support/bin/isort -f

CI went green here: https://travis-ci.org/pantsbuild/pants/builds/49721924

JS
  1. OK - `rbt patch 1726` works on master so this RB takes over for the now-discarded https://rbcommons.com/s/twitter/r/1723/
  2. 
      
ZU
  1. I only reviewed the first 4 files...

  2. build-support/bin/ci.sh (Diff revision 1)
     
     

    This is so great!

  3. build-support/bin/isort.sh (Diff revision 1)
     
     

    You don't want to to examples or testprojects?

    1. Good catch - I see no reason not to add those.  I'd like to circle back though and add those dirs in a new RB - this one is already unwieldy in size for RB and surface area for merge conflicts.
  4. 
      
PA
  1. Ship It!
  2. 
      
JS
  1. Thanks folks - submitted @ https://github.com/pantsbuild/pants/commit/d73c055446dbc9880e5e3f5684a0bcb30ee8aa02
  2. 
      
JS
Review request changed

Status: Closed (submitted)

Loading...