Change default ./pants fmt.isort <empty> behavior to no-op; Add sources check for isort.

Review Request #4327 - Created Oct. 18, 2016 and submitted

Information
Yi Cheng
pants
3989
Reviewers
pants-reviews
benjyw, jsirois, kwlzn, mateor, nhoward_tw, stuhood

Simplify the behavior of ./pants fmt.isort <empty> because release 1.2.0 is already saying the following, so this change makes it happen.

WARN] The behavior of `./pants fmt.isort` (no explicit targets) will soon become a no-op. To remove this warning, please specify one or more explicit target specs (e.g. `./pants fmt.isort ::`).

Behavior:
./pants fmt.isort <targets> -- <args, e.g. "--recursive ."> will sort the files only related
to specified targets, but the way of finding the config(s) is vanilla. If no target is
specified or no python source file is found in <targets>, it would be a no-op.

  • Add check for sources with target specified, otherwise fmt.isort a Java target will result empty python sources with the following error:
$ ./pants fmt.isort examples/tests/java/org/pantsbuild/example/hello/greet/:: -- --check-only

23:41:24 00:00 [main]
               (To run a reporting server: ./pants server)
23:41:24 00:00   [setup]
23:41:24 00:00     [parse]
               Executing tasks in goals: bootstrap -> fmt
23:41:24 00:00   [bootstrap]
23:41:24 00:00     [substitute-aliased-targets]
23:41:24 00:00     [jar-dependency-management]
23:41:24 00:00     [bootstrap-jvm-tools]
23:41:24 00:00     [provide-tools-jar]
23:41:24 00:00   [fmt]
23:41:24 00:00     [isort]ERROR: /Users/yic/workspace/pants/build-support/isort.venv/bin/activate_this.py Imports are incorrectly sorted.
ERROR: /Users/yic/workspace/pants/build-support/isort.venv/lib/python2.7/_abcoll.py Imports are incorrectly sorted.
ERROR: /Users/yic/workspace/pants/build-support/isort.venv/lib/python2.7/codecs.py Imports are incorrectly sorted.
ERROR: /Users/yic/workspace/pants/build-support/isort.venv/lib/python2.7/linecache.py Imports are incorrectly sorted.
...

Other minor change:
* Add back one target name for intellij pants plugin missing deps test, as it currently depends on the name to function.

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

Issues

  • 0
  • 2
  • 0
  • 2
Description From Last Updated
Yi Cheng
Mateo Rodriguez
Benjy Weinberger
Yi Cheng
Mateo Rodriguez
Yi Cheng
Yi Cheng
Mateo Rodriguez
Nick Howard (Twitter)
Yi Cheng
Yi Cheng
Review request changed

Status: Closed (submitted)

Change Summary:

45e4e6bb334e4b82b61c126f84c5d13e04dcbbf5 thanks gents!

Loading...