nedbat / scriv

Changelog management tool

Home Page:https://scriv.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Config resolved twice, resulting in not picking up MD fragment template

brettcannon opened this issue · comments

With the following config in changelog.d/scriv.ini:

[tool.scriv]
format = md

I end up with fragments from the rst template. If I drop the following line:

self.resolve_all()

the issue goes away. It turns out that Config.resolve_all() is called twice: once with no settings read from the config file and again after reading the config. It looks like the first call sets config.new_fragment_template to the actual template and then subsequent resolve_all() don't update it since the file: new_fragment.${config:format}.j2 string has been replaced already.

This also affects the output file. I am working around it by explicitly specifying the settings that try to use format implicitly:

new_fragment_template = file: new_fragment.md.j2
output_file = CHANGELOG.md

This is now available in version 0.12.0