St. Leo
Chieftain
As far as I know, there isn't an existing linting tool for rules.txt and similar files. I wanted something that can detect loops in the tech tree, so I had a quick hacking session last night and wrote civ2lint: https://github.com/leonsp/civ2lint/releases
I've only tested it on Mac, but Go makes cross-compilation easy so I've attached Windows executables to the release. I don't know what the user experience of running unsigned internet executables is on Windows these days, but for now I'm not testing them myself. I use Crossover (fancy paid Wine) to run the Windows release of Civilization II on my Mac
What other common issues should it detect? Detecting a mix-up of comma/period/semicolon, or copy-pasting a line too many times should be straightforward. It'll take a bit of work before it can warn you of the combination of Gunpowder and the Musketeer slot unit making other units unbuildable.
It needs a bit of love before it gets more features. Current output looks like this:
The useful part of that is
I've only tested it on Mac, but Go makes cross-compilation easy so I've attached Windows executables to the release. I don't know what the user experience of running unsigned internet executables is on Windows these days, but for now I'm not testing them myself. I use Crossover (fancy paid Wine) to run the Windows release of Civilization II on my Mac
What other common issues should it detect? Detecting a mix-up of comma/period/semicolon, or copy-pasting a line too many times should be straightforward. It'll take a bit of work before it can warn you of the combination of Gunpowder and the Musketeer slot unit making other units unbuildable.
It needs a bit of love before it gets more features. Current output looks like this:
❯ pkg/civ2lint_darwin_arm64 -path ~/Downloads/Civ2point5
...
{"level":"error","ts":1733924305.642095,"caller":"cmd/civ2lint.go:33","msg":"found loop: [Rad E1 SFl Roc], Rad\nfound loop: [SFl Roc Rad E1], SFl\nfound loop: [Gen Min Cmp Rad E1 SFl Roc], Rad\nfound loop: [AFl Rad E1 SFl Roc], Rad\nfound loop: [Las Cmp Rad E1 SFl Roc], Rad\nfound loop: [Cmp Rad E1 SFl Roc], Rad\nfound loop: [Too E1 SFl Roc Rad], E1\nfound loop: [Lab Too E1 SFl Roc Rad], E1\nfound loop: [Min Cmp Rad E1 SFl Roc], Rad\nfound loop: [Sup SFl Roc Rad E1], SFl\nfound loop: [Roc Rad E1 SFl], Roc\nfound loop: [Rob Las Cmp Rad E1 SFl Roc], Rad\nfound loop: [E1 SFl Roc Rad], E1","stacktrace":"github.com/leonsp/civ2lint/cmd.Init\n\tgithub.com/leonsp/civ2lint/cmd/civ2lint.go:33\nmain.main\n\tgithub.com/leonsp/civ2lint/main.go:8\nruntime.main\n\truntime/proc.go:272"}
The useful part of that is
found loop: [Rad E1 SFl Roc]