Skip to content

Commit 0b5aa3b

Browse files
support authorship percentage
1 parent 6ec7b62 commit 0b5aa3b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

mkdocs_git_authors_plugin/git/page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def get_authors(self):
6363
reverse = repo.config("show_line_count") or repo.config("show_contribution") or repo.config("sort_authors_by") == "contribution"
6464
self._authors = sorted(self._authors, key=repo._sort_key, reverse=reverse)
6565
self._sorted = True
66-
# TODO - Remove authors with under a certain line percentage
6766
author_threshold = repo.config("authorship_threshold_percent")
67+
print(f"threshold={author_threshold}", f"authors={self._authors}")
6868
if author_threshold > 0 and len(self._authors) > 1:
6969
self._authors = [a for a in self._authors if a.contribution()*100 > author_threshold]
7070
return self._authors

tests/basic_setup/mkdocs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ use_directory_urls: true
33

44
plugins:
55
- search
6-
- git-authors
6+
- git-authors:
7+
sort_authors_by: "contribution"
8+
authorship_threshold_percent: 50

0 commit comments

Comments
 (0)