pantsbuild/pants — pull request #192 by ericzundel (2014-06-05 23:39:43+00:00)
Title: Updated build file parser error message when the same target is redefined

In our repo we make use of the BUILD. style BUILD files and sometimes there is an error where someone has 2 files with the same target. Here is the error message users get:

AssertionError: BuildFileAddress(geocoding/BUILD.gen, geocoding) already in BuildGraph._target_proxy_by_address even though this BUILD file has not yet been added to the BuildGraph. The target type is:

I have attempted to improve the usability to end users:

pants.base.build_file_parser.SiblingConflictException: Both geocoding/BUILD and geocoding/BUILD.gen define the same target 'geocoding'

I also created a separate exception for when the same target is defined twice in the same file.