More miscellaneous cleanup

This commit is contained in:
Anthony Sottile 2020-01-12 21:17:59 -08:00
parent 489d9f9926
commit df40e862f4
33 changed files with 209 additions and 296 deletions

View file

@ -1,6 +1,7 @@
import argparse
import logging
import os.path
from typing import Optional
from typing import Tuple
from aspy.yaml import ordered_dump
@ -18,9 +19,9 @@ from pre_commit.xargs import xargs
logger = logging.getLogger(__name__)
def _repo_ref(tmpdir: str, repo: str, ref: str) -> Tuple[str, str]:
def _repo_ref(tmpdir: str, repo: str, ref: Optional[str]) -> Tuple[str, str]:
# if `ref` is explicitly passed, use it
if ref:
if ref is not None:
return repo, ref
ref = git.head_rev(repo)