Ability to filter list options.

Review Request #3997 — Created June 11, 2016 and submitted — Latest diff uploaded

benjyw
pants
pants-reviews
nhoward_tw, stuhood, zundel

Generalizes the "EXTEND" functionality of ListValueComponent to "MODIFY". Each ListValueComponent now stores a list of appends and a list of filters, and these get applied when the final val is requested.

Introduces two new forms of syntax for values of list options:

  1. -['foo', 'bar'] filters those values from the running list computation.
  2. ...,...,... splits the value on the commas and merges the results of evaluating the ....

The latter allows you to both append to and filter a list in, say, pants.ini:

list_option: -[1,2,3],+[4,5,6]

Added tests of the new syntax and functionality. All options tests pass. Full CI running here: http://jenkins.pantsbuild.org/job/pantsbuild/job/pants/branch/PR-3583/

Loading...