Skip to content

Commit 9bdd9ec

Browse files
authored
Merge pull request #172 from LilSpazJoekp/fix-pyproject-section-adornments
Fix resolving adornments from pyproject.toml
2 parents 9c41b48 + cac4730 commit 9bdd9ec

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
Unreleased
77
************
88

9+
**Fixed**
10+
11+
- Fix resolving section adornments from pyproject.toml.
12+
913
********************
1014
2.0.1 (2025/12/27)
1115
********************

docstrfmt/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,19 +387,21 @@ def _validate_adornments(
387387
:raises click.BadParameter: If adornments are not unique.
388388
389389
"""
390-
actual_value = value or context.params["section_adornments"]
390+
actual_value = context.params.pop("section_adornments", value)
391391

392392
if len(actual_value) != len(set(actual_value)):
393393
msg = "Section adornments must be unique"
394394
raise click.BadParameter(msg)
395395

396396
if "|" in actual_value:
397397
with_overline, without_overline = actual_value.split("|", 1)
398-
return list(zip(with_overline, itertools.repeat(True))) + list(
398+
adornments = list(zip(with_overline, itertools.repeat(True))) + list(
399399
zip(without_overline, itertools.repeat(False))
400400
)
401+
else:
402+
adornments = list(zip(actual_value, itertools.repeat(False)))
401403

402-
return list(zip(actual_value, itertools.repeat(False)))
404+
return adornments
403405

404406

405407
async def _run_formatter(

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)