read in FormattingConfig correctly

This commit is contained in:
Maximilian Keßler 2022-02-09 19:14:00 +01:00
parent 8a6bfef421
commit e84030978c

View file

@ -53,6 +53,7 @@ class FormattingConfig(Config):
header = filled_content[YAML_HEADER]
extra = header[YAML_EXTRA]
self._include_extra_header = extra[YAML_INCLUDE_EXTRA_HEADER]
if extra[YAML_PATH] or extra[YAML_TEXT]:
self._extra_header = GenericText(
extra[YAML_PATH] if extra[YAML_PATH] else extra[YAML_TEXT]
)
@ -60,6 +61,7 @@ class FormattingConfig(Config):
repo = header[YAML_REPO]
self._include_repo_info_text = repo[YAML_INCLUDE_INFO_TEXT]
self._include_repo_version = repo[YAML_INCLUDE_VERSION]
if repo[YAML_PATH] or repo[YAML_TEXT]:
self._repo_info_text = GenericText(
repo[YAML_PATH] if repo[YAML_PATH] else repo[YAML_TEXT]
)
@ -67,6 +69,7 @@ class FormattingConfig(Config):
pytex = header[YAML_PYTEX]
self._include_pytex_info_text = pytex[YAML_INCLUDE_INFO_TEXT]
self._include_pytex_version = pytex[YAML_INCLUDE_VERSION]
if pytex[YAML_PATH] or pytex[YAML_TEXT]:
self._pytex_info_text = GenericText(
pytex[YAML_PATH] if pytex[YAML_PATH] else pytex[YAML_TEXT]
)
@ -75,6 +78,7 @@ class FormattingConfig(Config):
license_ = header[YAML_LICENSE]
self._include_license = license_[YAML_INCLUDE_LICENSE]
if license_[YAML_PATH] or license_[YAML_TEXT]:
self._license = GenericText(
license_[YAML_PATH] if license_[YAML_PATH] else license_[YAML_TEXT]
)