From d1dbde0b2fb4cfcf163d6845bca1d1755fbc06f2 Mon Sep 17 00:00:00 2001 From: robcxyz Date: Sun, 16 Jul 2023 01:09:33 +0700 Subject: [PATCH] fix: issue with hook defaults being overwritten when called - remove unneeded code modifies hook --- tackle/parser.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/tackle/parser.py b/tackle/parser.py index fcc5deba3..1f2c2f692 100644 --- a/tackle/parser.py +++ b/tackle/parser.py @@ -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