Validate command line options regardless whether goals use them.

Review Request #3594 — Created March 21, 2016 and submitted

wisechengyi
pants
2254
pants-reviews
benjyw, nhoward_tw, patricklaw, stuhood, zundel

Earlier command line options are not parsed/validated unless used by the goals.
E.g. ./pants bundle --jvm-invalid does not error. This change proactively validates the command line options.

The performance impact is minimal:

[tw-mbp-yic pants (master)]$ time for i in `seq 20`;do ./pants goals --jvm-bundle-archive=zip ; done &> /dev/null 

real    0m12.918s
user    0m8.556s
sys 0m4.429s

[tw-mbp-yic pants (silent_arg_fix)]$ time for i in `seq 20`;do ./pants goals --jvm-bundle-archive=zip ; done &> /dev/null 

real    0m12.943s
user    0m8.429s
sys 0m4.370s

Green: https://travis-ci.org/wisechengyi/pants/builds/117776861

  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
  1. Nice! Didn't think it would be this simple.

  2. 
      
  1. 
      
  2. src/python/pants/engine/round_engine.py (Diff revision 1)
     
     

    It might be worth giving some more context in the comment. Explain that option values are usually computed lazily on-demand, but we eagerly compute options that were specified using cmd-line flags, so we can validate those flags.

    1. Comment refined. Thanks!

  3. 
      
  1. 
      
  2. src/python/pants/engine/round_engine.py (Diff revision 2)
     
     

    This comment exceeds the 100 character line limit. Please split into two lines.

    1. got tricked by intellij's line cut at 120 chars. thanks!

  3. 
      
  1. Ship It!
  2. 
      
  1. Ship It!
  2. 
      
  1. Ship It!
  2. 
      
Review request changed

Status: Closed (submitted)

Change Summary:

0574386aa74a5fea17ad211329ecdfd77e894b9b

Thanks everyone!

Loading...