elistevens / xws-spec

X-Wing Squadron Specification
75 stars 15 forks source link

Compliance Format #25

Open voidstate opened 7 years ago

voidstate commented 7 years ago

Hi all

It has just occurred to me that it might be useful to be able to automatically check that XWS-compliant apps are using the correct XWS names.

If apps had a simple endpoint that output (for example) a JSON object of ships -> pilots, then we could have a script that checked that data to ensure there were no errors.

No more waiting for a user to report a bug. You could just run a test.

Sound useful?

guidokessels commented 7 years ago

It'd be great to automatically detect errors or missing items. However, the XWS spec is usually updated much slower then the squad builders so you won't see any problems until later.

elistevens commented 7 years ago

I've been thinking about adding a section of .json files that have squads to use as a test suite. Stuff like a squad with every rebel pilot, a squad with every upgrade, etc. along with some invalid squads (Palp on a TIE shuttle, Palp in a Phantom, Sabine with Sabine, etc.).

Having a web service means hosting, and I'd imagine this stuff would be better done as a build-time test (when new content gets added), rather than something done on the fly.

As Guido points out, I haven't been particularly prompt to update XWS spec, so any failures would have to be manually examined anyway.

That said, check out the JSON here, which contains the full list of stuff in the spec (it's the data source for README_NAMES.md). It's included in the bower package, or you could reference it directly from github.

https://github.com/elistevens/xws-spec/tree/master/dist

guidokessels commented 7 years ago

@elistevens I keep the xwing-data repository fairly up to date. If you want I can automatically create a pull with updates to your json files in dist every time I update my repository?

My preference would also be to have something I can run locally. How about a simple test runner that automatically validates an input json against the spec? You could make it part of your build process and run it every time you do an update.

elistevens commented 7 years ago

Heh, I already have a script that makes mechanical updates as easy as make yasb; make that pulls all of the source data from Geordan's coffeescripts/cards-common.coffee in YASB. As long as he keeps the builder updated, getting new pilots and upgrades in should be fine.

The tough part is getting stuff like how to handle Hero Poe, etc. sorted out with the rest of the community. I dropped the ball on that one; we'd gotten it mostly worked out, and then my interest in x-wing waned for a bit (combo of lack of sleep due to our second kid, jm15ks warping the meta, burnout) and I let the spec sit for too long.

On Tue, Nov 8, 2016 at 1:17 PM, Guido Kessels notifications@github.com wrote:

@elistevens https://github.com/elistevens I keep the xwing-data repository fairly up to date. If you want I can automatically create a pull with updates to your json files in dist every time I update my repository?

My preference would also be to have something I can run locally. How a simple test runner that automatically validates an input json against the spec? You could make it part of your build process and run it every time you do an update.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/elistevens/xws-spec/issues/25#issuecomment-259262275, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIbIOjg0JOf7S0gv6cu7aX_REWREGTPks5q8ObegaJpZM4KsvNB .