Skip to content

Commit

Permalink
Hack in a rule_dir field. Need to redo how config works...
Browse files Browse the repository at this point in the history
  • Loading branch information
aappleby committed Mar 12, 2024
1 parent 7c6a41f commit 7fca741
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hancho.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,16 @@ def __init__(self, **kwargs):
super().__init__(self)
self.base = None
self |= kwargs
if config is not None and self.rule_dir is None:
self.rule_dir = relpath(
Path(inspect.stack(context=0)[1].filename).parent, self.root_dir
)

def __missing__(self, key):
if self.base:
# Why does this trigger pylint?
return self.base[key] # pylint: disable=unsubscriptable-object
if id(self) != id(config):
if config is not None and id(self) != id(config):
return config[key]
return None

Expand Down Expand Up @@ -566,7 +570,6 @@ async def run_async(self):
if self.debug:
log("")


########################################

async def task_main(self):
Expand Down

0 comments on commit 7fca741

Please sign in to comment.