Separate cli spec parsing from filesystem walking

Review Request #3466 - Created Feb. 16, 2016 and submitted

Stu Hood
benjyw, gmalmquist, jsirois

This change helps to make CmdLineSpecParser conform to its name, by having it handle only the parsing of specs, and not their application. This allows for a cleaner contract between BuildFileAddressMapper and CmdLineSpecParser, and makes reuse of the parsing code easier. In particular, I'd like to use the resulting datatypes to drive target selection in the new engine.

  • Add a datatype helper that subclasses namedtuple, but includes its type in equality checks
    • Without a helper like this, the following assert fails because the type is not included:
class A(namedtuple('A', ['one'])): pass
class B(namedtuple('B', ['two'])): pass
assert A('identical') != B('identical')
  • Add "case" classes for the three existing CLI spec forms:
    • SingleAddress
    • DescendantAddresses
    • SiblingAddresses
  • Move filesystem walking out of CmdLineSpecParser and into BuildFileAddressMapper
  • Migrate all relevant tests to BuildFileAddressMapper*Test


  • 0
  • 3
  • 1
  • 4
Description From Last Updated
Garrett Malmquist
Yi Cheng
Benjy Weinberger
Stu Hood
Garrett Malmquist
Stu Hood
Review request changed

Status: Closed (submitted)

Change Summary:

Merged as 823bc0494ae30f6eb62015662af225369fb25fdc