Introduce fmt goal, isort subgoal

Review Request #4134 - Created Aug. 2, 2016 and submitted

Information
Yi Cheng
pants
3747
Reviewers
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

Issues

  • 0
  • 8
  • 2
  • 10
Description From Last Updated
Kris Wilson
Benjy Weinberger
Benjy Weinberger
Yi Cheng
Ity Kaul
Nick Howard (Twitter)
Yi Cheng
Benjy Weinberger
Yi Cheng
Yi Cheng
Mateo Rodriguez
Nick Howard (Twitter)
Yi Cheng
Review request changed

Status: Closed (submitted)

Change Summary:

9ccbabf1d636f88192db5f00b256e50fd7b61189

Loading...