Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make HashEnricher config optional #157

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maxtheaxe
Copy link

Fixes #156. The same concept could be applied to Step itself, by updating __init__() with something like the following.

if config:
    for k, v in config.get(self.name, {}).items():
        self.__setattr__(k, v)
else: # allow initialization with default values
    for k, v in self.configs():
        self.__setattr__(k, v)

I wasn't sure of your preferences, so I figured I'd only add it where necessary for the time being, though I'm happy to refactor it.

@msramalho
Copy link
Contributor

thanks for the submission! The root issue here is indeed having the html_formatter depend on the hash_enricher being used -> not a guarantee. My preference will be to actually have a sensible default value here

https://github.com/bellingcat/auto-archiver/blob/feat/bluesky-archiver/src/auto_archiver/formatters/html_formatter.py#L57

rather than (maintaing the) coupling the hash_enricher with other steps' logic.

we may also need to rethink the need for the archivingContext altogether here, the "original sin" was blindly coupling both steps in the past, so we should revert that coupling instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No hashing algorithm defined for use in HtmlFormatter when HashEnricher not included
2 participants