Edit Config.get_required so as to raise error for any blank options.

Review Request #1638 - Created Jan. 22, 2015 and submitted

Information
Mateo Rodriguez
pants
f222792...
Reviewers
pants-reviews
benjyw, jsirois, zundel

As it stood, get_required would not raise a ConfigError for strings
(the default) if the option was left blank, unlike other data types.
A str option that was left blank was parsed as '' and any error
catching was left to the tooling. This adds an explicit check for
times where get_required() could return an empty string instead of the
expected None.

If a blank option is a viable choice, I think get(...default="") is
a better choice for those situations. I added a set of get_required
tests as well.

PANTS_DEV=1 ./pants test tests/python/pants_test:all : Success
Travis Passed: https://travis-ci.org/pantsbuild/pants/builds/47998589

Issues

  • 0
  • 2
  • 0
  • 2
Description From Last Updated
Benjy Weinberger
Benjy Weinberger
Mateo Rodriguez
Benjy Weinberger
John Sirois
Mateo Rodriguez
John Sirois
Mateo Rodriguez
Review request changed

Status: Closed (submitted)

Loading...