Skip to content

Commit 20c9bcd

Browse files
committed
docs: automate the documentation of deprecated configuration names
1 parent b17597e commit 20c9bcd

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

docs/configuration.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,20 @@ Deprecated Settings
397397
Some names in the config file have been updated. The old names will continue to
398398
work, but the new names are preferred:
399399

400+
.. [[[cog
401+
from scriv.config import DEPRECATED_NAMES
402+
403+
print()
404+
for old, new in DEPRECATED_NAMES:
405+
print(f"- ``{old}`` is now ``{new}``.")
406+
print()
407+
.. ]]]
408+
400409
- ``output_file`` is now ``changelog``.
401410
- ``insert_marker`` is now ``start_marker``.
402411

412+
.. [[[end]]] (checksum: c0c4c703b20146d23fe0cba53a324d3b)
413+
403414
404415
.. _git_settings:
405416

src/scriv/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class _Options:
225225

226226

227227
# Map of old config names to new config names.
228-
REPLACED_NAMES = [
228+
DEPRECATED_NAMES = [
229229
("output_file", "changelog"),
230230
("insert_marker", "start_marker"),
231231
]
@@ -341,7 +341,7 @@ def read_one_config(self, configfile: str) -> None:
341341
scriv_data = parser[section_name]
342342
for attrdef in attr.fields(_Options):
343343
self.get_set_option(scriv_data, attrdef.name, attrdef.name)
344-
for old, new in REPLACED_NAMES:
344+
for old, new in DEPRECATED_NAMES:
345345
self.get_set_option(scriv_data, old, new)
346346

347347
def read_one_toml(self, tomlfile: str) -> None:
@@ -377,7 +377,7 @@ def read_one_toml(self, tomlfile: str) -> None:
377377
return
378378
for attrdef in attr.fields(_Options):
379379
self.get_set_option(scriv_data, attrdef.name, attrdef.name)
380-
for old, new in REPLACED_NAMES:
380+
for old, new in DEPRECATED_NAMES:
381381
self.get_set_option(scriv_data, old, new)
382382

383383
def resolve_value(self, value: str) -> str:

0 commit comments

Comments
 (0)