Commit 9a9c452b00

9a9c452b00efd9d3d8ec52667f638781c72f6720

parent: 3b6a18fdec

Unsigned

Alicia Sykes <alicia@omg.lol> · 2026-02-23 21:58 UTC

Fix check for multiple changes

Layout: unified · split

lib/checks/check-additions.py +3 −2
@@ -143,8 +143,9 @@ def check_single_entry(diff):
143143 if added_count > 1:
144144 return MULTIPLE_MSG
145145 if added_count == 0:
146 sec_count = len(diff.get("sections", []))
147 if sec_count > 1:
146 added_sections = [s for s in diff.get("sections", [])
147 if s.get("change_type") == "added_section"]
148 if len(added_sections) > 1:
148149 return MULTIPLE_MSG
149150 return None
150151
lib/checks/check-yaml-diff.py +3 −2
@@ -191,8 +191,9 @@ def main():
191191 if added_count > 1:
192192 print(red(f"Single-entry rule violation: {added_count} service additions found."), file=sys.stderr)
193193 sys.exit(EXIT_RULE_VIOLATION)
194 if added_count == 0 and len(sections) > 1:
195 print(red(f"Single-entry rule violation: {len(sections)} section changes found."), file=sys.stderr)
194 added_sections = [s for s in sections if s["change_type"] == "added_section"]
195 if added_count == 0 and len(added_sections) > 1:
196 print(red(f"Single-entry rule violation: {len(added_sections)} section additions found."), file=sys.stderr)
196197 sys.exit(EXIT_RULE_VIOLATION)
197198
198199 total = len(added) + len(removed) + len(modified)