Don't modify globs excludes argument value.

Review Request #2841 - Created Sept. 17, 2015 and submitted

Information
Nick Howard (Twitter)
pants
2213
04b8491...
Reviewers
pants-reviews
dturner-tw, jsirois, molsen

Ideally, users shouldn't be using variables in BUILD files, but if they do, we shouldn't be modifying their values.

The error message that comes up is like this when the excludes value is reused as a sources list:

                   File ".../src/python/pants/base/target.py", line 545, in create_sources_field
                     assert_list(sources, key_arg=key_arg)
                   File ".../src/python/pants/base/validation.py", line 49, in assert_list
                     .format(key_msg, expected_type, e, e.__class__))
                 ValueError: In key 'sources': Expected a list containing values of type (<type 'basestring'>,), instead got a value ['fleem.java'] of <type 'list'>

Wrote regression test, saw that it failed. Updated implementation and made it pass.

Issues

  • 1
  • 1
  • 0
  • 2
Description From Last Updated
If the only other type we expect here is a container with exactly one string type in it, we may ... Matt Olsen Matt Olsen
Nick Howard (Twitter)
Stu Hood
Patrick Lawson
Nick Howard (Twitter)
Matt Olsen
John Sirois
Nick Howard (Twitter)
John Sirois
Matt Olsen
David Turner
Nick Howard (Twitter)
Nick Howard (Twitter)
Review request changed

Status: Closed (submitted)

Change Summary:

https://github.com/pantsbuild/pants/commit/60bb82dc0ab7675728cb8ab182a0a70c354bdd04

Loading...