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

datagen: syntax checker and data linter #43

Open
4 tasks
jorgegv opened this issue Apr 30, 2021 · 0 comments
Open
4 tasks

datagen: syntax checker and data linter #43

jorgegv opened this issue Apr 30, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jorgegv
Copy link
Owner

jorgegv commented Apr 30, 2021

Make DATAGEN tool strictly check the syntax of the input files and elements according to the documentation, so that errors are more informative and can be more easily solved.

Design:

  • A tree can be built with the possible child nodes that each directive can/should have.
    OR:
  • Up to now, data input and checking in DATAGEN is separated from the data output functions. The data generation step is quite (completely?) segregated from the data input step.
  • We can ensure that the separation between data input and code generation is complete (if it is not)
  • We must also ensure that no die calls during code generations are due to data definition errors. It there are some cases of this, the checks and errors should be moved to the functions before code generation.
  • In the code generation stage, the only die's allowed are those for no write access, error writing files, etc. but we must be sure that the game data can be correctly generated with the data that has been read from the GDATA files.
  • Once we have ensured that the separation between data input and code generation is complete, we can add additional checks to the data input stage without disturbing the code generation stage. We will use the documentation to ensure that all the documented limits are also checked and enforced in the data input steps.
  • Then we can add a new flag to datagen.pl let's say, -v (for "verification"), or reuse -c (for "check") to indicate that we only want to check the syntax of the GDATA files
  • In datagen.pl we can check this flag just before the data generation functions, and end with a success message if it was supplied. If we reach that place, it means that GDATA file loading was successful, since if not we would have die'd in previous functions.
  • And if the "syntax check" is not supplied, continue as it is now, and generate all the code.

Tasks:

  • Ensure that no checks are done during code generation stage. If there are some, migrate the checks to the data input stage
  • Ensure that errors during code generation are only generated due to file conditions: no permissions, no disk space, etc.
  • Add "syntax check" flag and make DATAGEN stop with success message if the flag is supplied, instead of generating game code
  • Review DATAGEN documentation and ensure that all limitations mentioned there are also checked and reported by datagen.pl. Add new checks if needed to the data input stage.
@jorgegv jorgegv added this to the Release 0.5.0 milestone Sep 14, 2021
@jorgegv jorgegv changed the title datagen+flowgen: syntax checker datagen: syntax checker Oct 1, 2021
@jorgegv jorgegv added the enhancement New feature or request label Oct 3, 2021
@jorgegv jorgegv self-assigned this Sep 12, 2022
@jorgegv jorgegv modified the milestones: Release 0.5.0, Release 0.6.0 Sep 12, 2022
@jorgegv jorgegv changed the title datagen: syntax checker datagen: syntax checker and data linter Feb 26, 2024
@jorgegv jorgegv modified the milestones: Release 0.6.0, Release 0.7.0 Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant