Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build clean validate test all schemas schema-validate
.PHONY: build clean validate test all schemas schema-validate lint

DIST := dist
SRC := src
Expand All @@ -21,6 +21,12 @@ endif
uv run x4cat extract "$(X4_GAME_DIR)" -o $(SCHEMAS) -g '*.xsd'
@echo "Schemas extracted to $(SCHEMAS)/"

lint:
ifndef X4_GAME_DIR
$(error X4_GAME_DIR not set — e.g. make lint X4_GAME_DIR="/path/to/X4 Foundations")
endif
uv run x4cat validate-diff "$(X4_GAME_DIR)" $(SRC)

schema-validate:
uv run pytest tests/test_mod.py::TestSchema -q

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ make test # full test suite (includes build verification)
make clean # remove dist/
```

## Diff patch linting

Validate that all XML diff patches in `src/` have XPath selectors that match
the base game files they target:

```bash
make lint X4_GAME_DIR="/path/to/X4 Foundations"
```

Reports mismatches with file path, line number, and the failing XPath.
Skipped gracefully when no diff patches exist in `src/`.

## Schema validation

Optionally extract XSD schemas from your X4 install for full schema validation
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading