swarm-game / swarm

Resource gathering + programming game
Other
841 stars 52 forks source link

Check entities in descriptions #1407

Open xsebek opened 1 year ago

xsebek commented 1 year ago

In #1106, entities are tagged as raw code, but not validated. We should check that descriptions match the entity name. For example an entity could have been renamed, but the old name left in some tutorial.

Proposed solution is to add a function:

type RawType = String
findRawInlines: Scenario -> [(RawType, Text)]

and check that entities (Text) are in entity map of the scenario.

byorgey commented 5 months ago

I thought we were already doing this but I guess not. Since merging https://github.com/swarm-game/swarm/pull/1106 all the entities in descriptions are tagged with {=entity} (which gets parsed to some kind of tagged Markdown block). It should be fairly straightforward to add a CI check that finds all the things tagged as entities and ensure that they are valid entity names.

See also the relevant discussion at #1406.