about summary refs log tree commit diff
path: root/tools/git-blame-stats
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-10-17 19:15:02 -0700
committerFranck Cuny <franck@fcuny.net>2022-10-17 19:15:23 -0700
commit60ca05e1e2fb152dbeb69f0558be4d8f42e7b523 (patch)
tree5a935c1982408572da2b6cfbea57fcb53789349a /tools/git-blame-stats
parentfeat(home/python): add lsp/mypy packages (diff)
downloadworld-60ca05e1e2fb152dbeb69f0558be4d8f42e7b523.tar.gz
ref(tools/python): make mypy happy
Diffstat (limited to 'tools/git-blame-stats')
-rwxr-xr-xtools/git-blame-stats/git-blame-stats.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/git-blame-stats/git-blame-stats.py b/tools/git-blame-stats/git-blame-stats.py
index ee52ce4..3cc4f4a 100755
--- a/tools/git-blame-stats/git-blame-stats.py
+++ b/tools/git-blame-stats/git-blame-stats.py
@@ -2,7 +2,7 @@
 
 import argparse
 import subprocess
-import sys
+from typing import Any
 
 
 parser = argparse.ArgumentParser()
@@ -11,7 +11,7 @@ parser.add_argument(
 )
 args = parser.parse_args()
 
-authors = dict()
+authors: dict[str, Any] = dict()
 max_lenght_author = 0
 max_lenght_email = 0
 
@@ -50,9 +50,9 @@ files = get_files(args.rev)
 for filename in files:
     try:
         for block in line_info(filename.rstrip(), args.rev):
-            author = None
-            author_email = None
-            commit = None
+            author = ""
+            author_email = ""
+            commit = ""
             skip = False
             for i, val in enumerate(block):
                 if i == 0:
@@ -65,10 +65,10 @@ for filename in files:
                     author_email = " ".join(val.split()[1:])
                     continue
                 if val.startswith("\t") and val == "\t":
-                    skip == True
+                    skip = True
             if skip:
                 continue
-            if authors.get(author, None) == None:
+            if authors.get(author, None) is None:
                 authors[author] = {
                     "email": author_email,
                     "commits": set(),
@@ -82,7 +82,7 @@ for filename in files:
                 max_lenght_author = len(author)
             if len(author_email) > max_lenght_email:
                 max_lenght_email = len(author_email)
-    except Exception as e:
+    except Exception:
         continue
 
 for author, stats in authors.items():