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

Check code examples in entity descriptions as part of CI #309

Closed
byorgey opened this issue Feb 24, 2022 · 1 comment · Fixed by #1106
Closed

Check code examples in entity descriptions as part of CI #309

byorgey opened this issue Feb 24, 2022 · 1 comment · Fixed by #1106
Assignees
Labels
C-Moderate Effort Should take a moderate amount of time to address. G-Entities An issue having to do with game entities. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. T-Testing Involves the testing suite - unit and integration tests, also benchmarks. Z-CI This issue is about continuous integration pipelines - GH Actions - tests and releases on server. Z-Documentation This issue is about README or Wikis or Haddock or...

Comments

@byorgey
Copy link
Member

byorgey commented Feb 24, 2022

Is your feature request related to a problem? Please describe.
When making updates for #303 , we almost missed the fact that we needed to update some code examples in entity descriptions (@noahyor caught it). When updating the entity descriptions, I caught several other things that needed to be updated which had been out of date for a while.

Describe the solution you'd like
Code samples in entity descriptions ought to be automatically checked in our CI process (by parsing and typechecking them), just like code in the examples/ directory is checked.

I am not quite sure how this would work. There would need to be some special way to mark code examples in entity descriptions to make it possible to extract them during the CI process. Then we would have to process them specially when displaying entity descriptions. Maybe it's as simple as inventing some special delimiters, then stripping those delimiters when displaying entity descriptions.

@byorgey byorgey added Z-Feature A new feature to be added to the game. C-Moderate Effort Should take a moderate amount of time to address. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. G-Entities An issue having to do with game entities. T-Testing Involves the testing suite - unit and integration tests, also benchmarks. labels Feb 24, 2022
@byorgey
Copy link
Member Author

byorgey commented May 7, 2022

Another benefit of specially delimiting code examples in entity descriptions would be that we could syntax highlight them (#574).

The simplest idea might just be to use triple backticks like Github-flavored Markdown. In fact, we might consider using Markdown in general.

@xsebek xsebek added Z-CI This issue is about continuous integration pipelines - GH Actions - tests and releases on server. and removed Z-Feature A new feature to be added to the game. labels Jun 18, 2022
@xsebek xsebek mentioned this issue Jul 28, 2022
@byorgey byorgey added the Z-Documentation This issue is about README or Wikis or Haddock or... label Aug 19, 2022
xsebek added a commit that referenced this issue Feb 13, 2023
@xsebek xsebek self-assigned this Feb 13, 2023
xsebek added a commit that referenced this issue Aug 2, 2023
- closes #309
- part of #545 and #574

Restyled by fourmolu (#1107)

Co-authored-by: Restyled.io <commits@restyled.io>
@mergify mergify bot closed this as completed in #1106 Aug 5, 2023
mergify bot pushed a commit that referenced this issue Aug 5, 2023
* use CommonMark to parse simple markdown AST parametrised on inline/block code
* validate swarm code (`Document Text -> Document Syntax`)
* update descriptions to use markdown with following conventions:
  - `move` - valid swarm code (the easy to write default)
  - `wedge`{=entity} - for swarm entities
  - `unit`{=type} - for swarm types
  - `require <a> <b>`{=snippet} - raw snippets for invalid code
  - **Alt-G** - bold for keyboard shortcuts
- highlight code in brick widgets
- closes #309
- closes #545
- precedes #574
- precedes #1406
- precedes #1407
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Moderate Effort Should take a moderate amount of time to address. G-Entities An issue having to do with game entities. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. T-Testing Involves the testing suite - unit and integration tests, also benchmarks. Z-CI This issue is about continuous integration pipelines - GH Actions - tests and releases on server. Z-Documentation This issue is about README or Wikis or Haddock or...
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants