Skip to content

Commit

Permalink
fix: issue with hook defaults being overwritten when called - remove …
Browse files Browse the repository at this point in the history
…unneeded code modifies hook
  • Loading branch information
robcxyz committed Jul 15, 2023
1 parent 2ab1ad1 commit d1dbde0
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions tackle/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,26 +190,6 @@ def enrich_hook(
context=context,
)

# Handle kwargs
for k, v in kwargs.items():
if k == 'args':
# TODO: I thought this would work
# args.append(v)
# But just passing works. Reason is the above duplicates the arg. No idea...
pass
elif k == 'kwargs':
pass
elif k in hook.__fields__:
# TODO: consolidate with `update_hook_with_kwargs_and_flags` - same same
if hook.__fields__[k].type_ == bool:
# Handle flags where default is true
if hook.__fields__[k].default:
hook.__fields__[k].default = False
else:
hook.__fields__[k].default = True
else:
hook.__fields__[k].default = v

return hook


Expand Down

0 comments on commit d1dbde0

Please sign in to comment.