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

Code formatting issues - automate? #99

Open
hardbyte opened this issue Apr 13, 2018 · 2 comments
Open

Code formatting issues - automate? #99

hardbyte opened this issue Apr 13, 2018 · 2 comments
Assignees

Comments

@hardbyte
Copy link
Collaborator

hardbyte commented Apr 13, 2018

Consider applying black

Aha! Link: https://csiro.aha.io/features/ANONLINK-39

@hardbyte
Copy link
Collaborator Author

hardbyte commented Apr 13, 2018

See closed PR #110

Essentially the findings are that we can't use black (yet). The problem is we would have to change our inline type annotations for mypy. E.g. the function:

def double_hash_encode_ngrams_non_singular(ngrams,          # type: Iterable[str]
                              keys,            # type: Sequence[bytes]
                              k,               # type: int
                              l,               # type: int
                              encoding         # type: str
                              ):
    # type: (...) -> bitarray.bitarray
    """
    computes the double hash encoding of the provided n-grams with the given keys.

Formatted by black running with all defaults into:

def double_hash_encode_ngrams_non_singular(
    ngrams,
    keys,
    k,
    l,
    encoding,  # type: Iterable[str]  # type: Sequence[bytes]  # type: int  # type: int  # type: str
):
    # type: (...) -> bitarray.bitarray
    """
    computes the double hash encoding of the provided n-grams with the given keys.
    ...

Which mypy doesn't like.

@hardbyte
Copy link
Collaborator Author

Black have patched to now handle type annotations so could we worth trying this again.

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

No branches or pull requests

1 participant