Introduce fmt goal, isort subgoal

Review Request #4134 — Created Aug. 2, 2016 and submitted — Latest diff uploaded

wisechengyi
pants
3747
pants-reviews
benjyw, kwlzn, stuhood, zundel

Introduce isort task, so users don't have to sort their python imports manually.

The idea of subgoal under fmt goal is that in the future, there can be fmt.{go, java, mypi, etc}

Behavior:
1. ./pants fmt.isort <targets> will sort the files only related to those targets, but the way of finding the config is vanilla.
2. Additional arguments can be passed as passthrough. e.g. ./pants fmt.isort <targets> -- --check-only
3. ./pants fmt.isort -- <args, "e.g. --recursive ." > means both the files to be sorted and the way of finding the config are vanilla.
4. ./pants fmt.isort means ./pants fmt.isort :: and NOT the entire repo directory which could include files not in any target.

Other change:
1. Add a tip at pythonstyle to direct user to use fmt.isort if there is issue related to import order.
2. Use build-support/bin/isort.sh is changed from isort <args> to ./pants fmt.isort -- <args>

https://travis-ci.org/pantsbuild/pants/builds/150804028

Loading...