Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
馃帹 Get fragment categories defaults from towncrier
Resolves #17
- Loading branch information
Showing
3 changed files
with
30 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,20 @@ | |
LABEL_PROVIDED, | ||
) | ||
|
||
try: | ||
from towncrier._settings import _default_types as _towncrier_default_types | ||
FALLBACK_CHANGE_TYPES = tuple(_towncrier_default_types) | ||
except ImportError: | ||
FALLBACK_CHANGE_TYPES = ( | ||
'bugfix', | ||
'doc', | ||
'feature', | ||
'misc', | ||
'removal', | ||
'trivial', | ||
'vendor', | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
webknjaz
Author
Member
|
||
) | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
@@ -255,14 +269,6 @@ async def on_pr(event): | |
async def compile_towncrier_fragments_regex(ref, name_settings): | ||
"""Create fragments check regex based on the towncrier config.""" | ||
fallback_base_dir = 'news' | ||
fallback_change_types = ( | ||
'bugfix', | ||
'doc', | ||
'feature', | ||
'removal', | ||
'trivial', | ||
'vendor', | ||
) | ||
|
||
# e.g. ``.rst``: | ||
fragment_filename_suffix = re.escape(name_settings.get('suffix', '')) | ||
|
@@ -274,7 +280,7 @@ async def compile_towncrier_fragments_regex(ref, name_settings): | |
) | ||
change_types = ( | ||
tuple(t['directory'] for t in towncrier_conf.get('type', ())) | ||
or fallback_change_types | ||
or FALLBACK_CHANGE_TYPES | ||
) | ||
|
||
# Ref: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ gunicorn | |
octomachinery | ||
pre-commit | ||
pylint | ||
towncrier | ||
unidiff |
This probably shouldn't be here.