Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-formatter for GDL game rules #38

Open
samschreiber opened this issue Nov 27, 2013 · 1 comment
Open

Auto-formatter for GDL game rules #38

samschreiber opened this issue Nov 27, 2013 · 1 comment
Assignees

Comments

@samschreiber
Copy link
Member

GGP Base should include a tool that automatically formats game rules in a clean, canonical way. Among other things, this should do the following:

  • Put each relation on a separate line, with splitting for long lines.
  • Group similar relations, and separate out important groups (role, next, legal, etc)
  • Trim unnecessary whitespace.

Ideally it would preserve comments (in one form or another), but that might be more challenging.

This should not change the semantics of the game at all. One possible use-case is having this run automatically for all of the games in an online game repository.

Given two game descriptions, you should get a meaningful easy-to-read report if you auto-format both and run them through a diff tool. This will make it substantially easier to understand the differences between different versions of the same game.

@ghost ghost assigned samschreiber Dec 3, 2013
@AlexLandau
Copy link
Member

The Griddle validation library now has a "GameIndenter" that does something like this; it fixes up the whitespace "canonically", but leaves comments and the large-scale structure of the file intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants