File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66from dataclasses import dataclass , field
77from typing import Callable , List , Optional , Tuple
88
9- from generate_changelog .configuration import Configuration , get_config
9+ from generate_changelog .configuration import Configuration
1010from generate_changelog .utilities import diff_index
1111
1212
@@ -38,6 +38,9 @@ class CommitContext:
3838 files : set = field (default_factory = set )
3939 """The file paths (relative to the repository root) modified by this commit."""
4040
41+ valid_author_tokens : List [str ] = field (default_factory = list )
42+ """The configured tokens in git commit trailers that indicate authorship."""
43+
4144 _authors : Optional [list ] = field (init = False ) # list of dicts with name and email keys
4245 _author_names : Optional [list ] = field (init = False ) # list of just the names
4346
@@ -64,7 +67,7 @@ def authors(self) -> list:
6467
6568 raw_authors = [self .committer ]
6669 trailers = self .metadata .get ("trailers" , collections .defaultdict (list ))
67- for token in get_config () .valid_author_tokens :
70+ for token in self .valid_author_tokens :
6871 raw_authors .extend (trailers .get (token , []))
6972 author_regex = re .compile (r"^(?P<name>[^<]+)\s+(?:<(?P<email>[^>]+)>)?$" )
7073
You can’t perform that action at this time.
0 commit comments