From ce4154025f31d250210c990994ace9d23f1355fe Mon Sep 17 00:00:00 2001 From: Evan Maddock Date: Fri, 3 Oct 2025 16:11:43 -0400 Subject: [PATCH 1/2] bump,update: Stop doing the weird aligning things with colons We've always done this thing where the colons in `package.yml` files were aligned; but only the top-level ones. While it arguably looks nicer (I personally disagree), it also makes it really hard to work with other YAML tooling, such as formatters. It also kept us from being able to automatically sort dependencies. Let's do away with it, unlocking us to use more standard tools. Signed-off-by: Evan Maddock --- ypkg2/cli/bump.py | 7 +++---- ypkg2/cli/update.py | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ypkg2/cli/bump.py b/ypkg2/cli/bump.py index ea4d682..e459581 100644 --- a/ypkg2/cli/bump.py +++ b/ypkg2/cli/bump.py @@ -18,6 +18,7 @@ ## to start with `- ?`. Override this limit in ruamel to allow us to continue to mangle the YAML spec in this way. ## 32x the limit oughta be enough for anyone, right? from ruamel.yaml.emitter import Emitter + Emitter.MAX_SIMPLE_KEY_LENGTH = 4096 @@ -38,13 +39,11 @@ def main(): fp.seek(0) yaml = YAML() data = yaml.load(fp) - data['release'] += 1 + data["release"] += 1 maxwidth = len(max(lines, key=len)) try: - with open(sys.argv[1], 'w') as fp: + with open(sys.argv[1], "w") as fp: yaml.indent(mapping=4, sequence=4, offset=4) - yaml.top_level_colon_align = True - yaml.prefix_colon = ' ' yaml.width = maxwidth yaml.dump(data, fp) except Exception as e: diff --git a/ypkg2/cli/update.py b/ypkg2/cli/update.py index 0fb3b53..8be048e 100644 --- a/ypkg2/cli/update.py +++ b/ypkg2/cli/update.py @@ -136,8 +136,6 @@ def main(): try: with open(ymlfile, "w") as fp: yaml.indent(mapping=4, sequence=4, offset=4) - yaml.top_level_colon_align = True - yaml.prefix_colon = " " yaml.width = maxwidth yaml.dump(data, fp) except Exception as e: From 621e7659412d36f0c49a41c349ec1c80e0c0dae9 Mon Sep 17 00:00:00 2001 From: David Harder Date: Fri, 5 Dec 2025 10:32:47 -0600 Subject: [PATCH 2/2] ybump: Tweak yaml indent This change should match prettier output (with indent = 4) and therefore yaml-language-server --- ypkg2/cli/bump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ypkg2/cli/bump.py b/ypkg2/cli/bump.py index e459581..84d7bf7 100644 --- a/ypkg2/cli/bump.py +++ b/ypkg2/cli/bump.py @@ -43,7 +43,7 @@ def main(): maxwidth = len(max(lines, key=len)) try: with open(sys.argv[1], "w") as fp: - yaml.indent(mapping=4, sequence=4, offset=4) + yaml.indent(mapping=4, sequence=6, offset=4) yaml.width = maxwidth yaml.dump(data, fp) except Exception as e: