()
return (local_commit, remote_commit)
Collect from pre-commit framework environment.
Collect from pre-commit framework environment.
Collect from pre - commit framework environment .
def collect_from_precommit_env() -> Tuple[Optional[str], Optional[str]]:
    """
    Collect from pre-commit framework environment.
    """
    # pre-commit framework <2.2.0
    local_commit = os.getenv("PRE_COMMIT_SOURCE", None)
    remote_commit = os.getenv("PRE_COMMIT_ORIGIN", None)

    if local_commit is None or remote_commit is None:
        # pre-commit framework >=2.2.0
        local_commit = os.getenv("PRE_COMMIT_FROM_REF", None)
        remote_commit = os.getenv("PRE_COMMIT_TO_REF", None)

    return (local_commit, remote_commit)
def collect_from_precommit_env ( ) -> Tuple [ Optional [ str ] , Optional [ str ] ] : # pre-commit framework <2.2.0 local_commit = os . getenv ( "PRE_COMMIT_SOURCE" , None ) remote_commit = os . getenv ( "PRE_COMMIT_ORIGIN" , None ) if local_commit is None or remote_commit is None : # pre-commit framework >=2.2.0 local_commit = os . getenv ( "PRE_COMMIT_FROM_REF" , None ) remote_commit = os . getenv ( "PRE_COMMIT_TO_REF" , None ) return ( local_commit , remote_commit )