Fixup the options bootstrapper to support boolean flags.

Review Request #1660 - Created Jan. 25, 2015 and submitted

Information
John Sirois
pants
jsirois/engine/yaks/fix_options_bootstrapper
987
15b9f47...
Reviewers
pants-reviews
benjyw, lahosken
Previously --no-* flags were ignored during options bootsrapping and,
for example, --no-pantsrc would thus be ignored. This fix lifts some
shared structure for flag classification and adds a (previosly failing)
test to confirm boolean no-arg bootstrap options can be inverted via
command line flag. The change does not address value defaulting through
env and config but probably makes it cleaner to address this hole in
uniform option handling should we decide to.

 src/python/pants/option/options_bootstrapper.py             |  9 ++++++++-
 src/python/pants/option/parser.py                           | 44 ++++++++++++++++++++++++++++++++------------
 tests/python/pants_test/option/test_options_bootstrapper.py | 22 +++++++++++++++-------
 3 files changed, 55 insertions(+), 20 deletions(-)

I came across this problem working on another branch. It led to
mysterious integration test errors since the integration test baseclass
passes --no-pantsrc to the pants subprocess and I had a ~/.pants.rc
fouling test expectations.

CI went green here:
https://travis-ci.org/pantsbuild/pants/builds/48200881

Larry Hosken
John Sirois
John Sirois
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Benjy Weinberger

Thanks for fixing! See minor comment below.

src/python/pants/option/parser.py (Diff revision 2)
 
 

This comment now seems confusing in this location. Either move, rephrase or just remove entirely.

  1. Agreed - killing it here: https://rbcommons.com/s/twitter/r/1664/

Loading...