[PR #729] [MERGED] mods: report swap conflicts in JSON and add check --strict (MODS-CONFLICT-REPORTING) #767

Closed
opened 2026-11-26 20:18:58 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/729
Author: @promise-ssss
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: feat/mods-conflict-reporting


📝 Commits (1)

  • 72e8616 mods: report swap conflicts in JSON and add check --strict

📊 Changes

2 files changed (+98 additions, -14 deletions)

View changed files

📝 tests/test_leonida_mods.py (+50 -0)
📝 tools/leonida_mods.py (+48 -14)

📄 Description

Claimed in the coordination issue as: MODS-CONFLICT-REPORTING

What and why

ools/leonida_mods.py already detected enabled archetype swap overrides in its plain-text print_report(), but 

eport_json() omitted override/conflict metadata and check had no strict mode to fail on warnings or swap conflicts.

This extracts a shared swap_conflicts(mods) helper used by print_report(),
eport_json(), and check --strict:

  • list --json and check --json now include overrides on overridden swap entries and a top-level conflicts list.
  • check --strict exits with code 1 when any manifest has warnings or any enabled swap conflicts with an earlier one in load order.
  • Added unit tests in ests/test_leonida_mods.py.

Tested

  • python -I tests/test_leonida_mods.py -v: 12/12 passed (0.073 s)
  • python -I scripts/check_no_game_data.py tools/leonida_mods.py tests/test_leonida_mods.py: passed
  • python -m compileall -q tools/leonida_mods.py tests/test_leonida_mods.py: clean

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/729 **Author:** [@promise-ssss](https://github.com/promise-ssss) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `feat/mods-conflict-reporting` --- ### 📝 Commits (1) - [`72e8616`](https://github.com/ubiquitarianism/leonida/commit/72e86164685f3c8dbce05261aeff47b3b03b53c6) mods: report swap conflicts in JSON and add check --strict ### 📊 Changes **2 files changed** (+98 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_leonida_mods.py` (+50 -0) 📝 `tools/leonida_mods.py` (+48 -14) </details> ### 📄 Description Claimed in the coordination issue as: MODS-CONFLICT-REPORTING ### What and why ools/leonida_mods.py already detected enabled archetype swap overrides in its plain-text print_report(), but eport_json() omitted override/conflict metadata and check had no strict mode to fail on warnings or swap conflicts. This extracts a shared swap_conflicts(mods) helper used by print_report(), eport_json(), and check --strict: - list --json and check --json now include overrides on overridden swap entries and a top-level conflicts list. - check --strict exits with code 1 when any manifest has warnings or any enabled swap conflicts with an earlier one in load order. - Added unit tests in ests/test_leonida_mods.py. ### Tested - `python -I tests/test_leonida_mods.py -v`: 12/12 passed (0.073 s) - `python -I scripts/check_no_game_data.py tools/leonida_mods.py tests/test_leonida_mods.py`: passed - `python -m compileall -q tools/leonida_mods.py tests/test_leonida_mods.py`: clean GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:58 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#767
No description provided.