Introduce fmt goal, isort subgoal
Review Request #4134 — Created Aug. 2, 2016 and submitted — Latest diff uploaded
Information | |
---|---|
wisechengyi | |
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 befmt.{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 usefmt.isort
if there is issue related to import order.
2. Usebuild-support/bin/isort.sh
is changed fromisort <args>
to./pants fmt.isort -- <args>
https://travis-ci.org/pantsbuild/pants/builds/150804028