Wrap scenario descriptions in docstrings (#787)

Otherwise, the lines can get kind of long.
This commit is contained in:
Zanie Blue 2024-01-04 13:43:50 -06:00 committed by GitHub
parent f89c6456e3
commit 8ac6f9a198
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 5 deletions

View file

@ -20,6 +20,7 @@ import json
import shutil
import subprocess
import sys
import textwrap
from pathlib import Path
@ -132,6 +133,10 @@ for index, scenario in enumerate(data["scenarios"]):
if scenario["name"] == "example":
data["scenarios"].pop(index)
# Wrap the description onto multiple lines
for scenario in data["scenarios"]:
scenario["description_lines"] = textwrap.wrap(scenario["description"], width=80)
# Render the template
print("Rendering template...", file=sys.stderr)
output = chevron_blue.render(template=TEMPLATE.read_text(), data=data, no_escape=True)