summaryrefslogtreecommitdiff
path: root/Biz/Dragons
diff options
context:
space:
mode:
Diffstat (limited to 'Biz/Dragons')
-rwxr-xr-xBiz/Dragons/main.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/Biz/Dragons/main.py b/Biz/Dragons/main.py
index 7ec80bb..7a94f99 100755
--- a/Biz/Dragons/main.py
+++ b/Biz/Dragons/main.py
@@ -20,7 +20,9 @@ def find_user(line: str) -> typing.Any:
return re.findall(r"^[^<]*", line)[0].strip()
-def authors_for(path: str, active_users: typing.List[str]) -> typing.Dict[str, str]:
+def authors_for(
+ path: str, active_users: typing.List[str]
+) -> typing.Dict[str, str]:
"""Return a dictionary of {author: commits} for given path. Usernames not in
the 'active_users' list will be filtered out."""
raw = subprocess.check_output(
@@ -71,7 +73,9 @@ def get_args() -> typing.Any:
"Parse CLI arguments."
cli = argparse.ArgumentParser(description=__doc__)
cli.add_argument("test", action="store_true", help="run the test suite")
- cli.add_argument("repo", default=".", help="the git repo to run on", metavar="REPO")
+ cli.add_argument(
+ "repo", default=".", help="the git repo to run on", metavar="REPO"
+ )
cli.add_argument(
"-b",
"--blackholes",
@@ -138,7 +142,9 @@ class Repo:
) -> None:
self.paths = [
p
- for p in subprocess.check_output(["git", "ls-files", "--no-deleted"])
+ for p in subprocess.check_output(
+ ["git", "ls-files", "--no-deleted"]
+ )
.decode("utf-8")
.split()
if not any(i in p for i in ignored_paths)
@@ -147,7 +153,9 @@ class Repo:
self.stats = {}
for path in self.paths:
self.stats[path] = authors_for(path, active_users)
- self.blackholes = [path for path, authors in self.stats.items() if not authors]
+ self.blackholes = [
+ path for path, authors in self.stats.items() if not authors
+ ]
self.liabilities = {
path: list(authors)
for path, authors in self.stats.items()