@@ -31,6 +31,7 @@ class GitCommittersPlugin(BasePlugin):
31
31
('enabled' , config_options .Type (bool , default = True )),
32
32
('cache_dir' , config_options .Type (str , default = '.cache/plugin/git-committers' )),
33
33
("exclude" , config_options .Type (list , default = [])),
34
+ ("exclude_committers" , config_options .Type (list , default = [])),
34
35
('token' , config_options .Type (str , default = '' )),
35
36
)
36
37
@@ -41,6 +42,7 @@ def __init__(self):
41
42
self .authors = dict ()
42
43
self .cache_page_authors = dict ()
43
44
self .exclude = list ()
45
+ self .exclude_committers = list ()
44
46
self .cache_date = ''
45
47
self .last_request_return_code = 0
46
48
self .githuburl = "https://api.github.com"
@@ -88,6 +90,7 @@ def on_config(self, config):
88
90
self .localrepo = Repo ("." , search_parent_directories = True )
89
91
self .branch = self .config ['branch' ]
90
92
self .excluded_pages = self .config ['exclude' ]
93
+ self .exclude_committers = self .config ['exclude_committers' ]
91
94
return config
92
95
93
96
# Get unique contributors for a given path
@@ -268,7 +271,13 @@ def list_contributors(self, path):
268
271
else :
269
272
LOG .info ("git-committers: fetching submodule info for " + path + " from repository " + submodule_repo + " with path " + path_in_submodule )
270
273
authors = self .get_contributors_to_file (path_in_submodule , submodule_repo = submodule_repo )
271
-
274
+
275
+ for exclude_committer in set (self .exclude_committers ):
276
+ for author in tuple (authors ):
277
+ if author ["login" ] == exclude_committer :
278
+ authors .remove (author )
279
+ break
280
+
272
281
if path not in self .cache_page_authors or self .cache_page_authors [path ] != {'last_commit_date' : last_commit_date , 'authors' : authors }:
273
282
self .should_save_cache = True
274
283
self .cache_page_authors [path ] = {'last_commit_date' : last_commit_date , 'authors' : authors }
0 commit comments