Fixup the options bootstrapper to support boolean flags.
Review Request #1660 - Created Jan. 24, 2015 and submitted
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:
Add an example for the expand_flags docs. src/python/pants/option/parser.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) --publish
Revision 2 (+70 -20)