Skip to content

Commit

Permalink
change thrift_linter.py to use new register_options
Browse files Browse the repository at this point in the history
Testing Done:
Take two. Previous change accidentally added "default=False" which was inappropriate and ended up breaking the logic that falls back to a value defined in the BUILD file. Now we explicitly default the flag to None and preserve the desired logic.

I ran the integration tests related to thrift linter, which I inadvertently broke in my last attempt at this:
  devpants goal test tests/python/pants_test/tasks:thrift_linter_integration

Reviewed at https://rbcommons.com/s/twitter/r/1225/
  • Loading branch information
jhump authored and ericzundel committed Oct 28, 2014
1 parent 8c0dad8 commit c8b4bd7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/python/pants/backend/codegen/tasks/thrift_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ def _is_thrift(target):
return target.is_thrift

@classmethod
def setup_parser(cls, option_group, args, mkflag):
super(ThriftLinter, cls).setup_parser(option_group, args, mkflag)

option_group.add_option(mkflag('strict'), mkflag('strict', negate=True),
dest='thrift_linter_strict',
default=None,
action='callback', callback=mkflag.set_bool,
help='[%default] Fail the goal if thrift linter errors are found.')
def register_options(cls, register):
super(ThriftLinter, cls).register_options(register)
register('--strict', default=None, action='store_true',
help='Fail the goal if thrift linter errors are found.',
legacy='thrift_linter_strict')

@classmethod
def product_types(cls):
Expand Down

0 comments on commit c8b4bd7

Please sign in to comment.