-
-
Couldn't load subscription status.
- Fork 150
refactor: move various file generation from tests to a separate crate #774
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
base: main
Are you sure you want to change the base?
Conversation
fb3e54a to
0600a16
Compare
|
Can you briefly explain this change? |
|
Pretty much what it says in the commit message. Instead of using tests for generating files like |
|
What is the motivation? |
|
Tests are intended for, well, testing, not for generating arbitrary files inside the repository. Especially since these tests are all in different places, it is not clear how and which files are generated. For example, creation of files inside |
|
Also, files which can be fully generated from existing files shouldn't be tracked by Git, since they bear zero entropy and can easily go out of sync. |
|
|
|
By the way, |
|
I like having generation in tests so I don't forget to run it. |
Isn't it hosted by the website as https://www.uiua.org/primitives.json? And it would be available on the |
Other than being unintuitive, this caused some troubles with Nix packaging (due to Nix making a lot of files read-only), but that was circumvented by disabling those "tests". |
Why would you need to "not forget to run it"? It can be done automatically by CI, for example. |
|
I think they folder should probably be called |
Renamed to |
In fact, |
fe5867d to
e3d085d
Compare
| ("example.ua", EXAMPLE_UA), | ||
| ("example.txt", EXAMPLE_TXT), | ||
| ("primitives.json", include_str!("../../../site/primitives.json")) | ||
| #[cfg(feature="default")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have feature gates in the pad?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make site and uiua-editor usable as libraries without pulling unnecessary stuff. site::markdown::markdown_html is hard to decouple from the site crate, so generator needs to depend on site. For that, a more or less minimal version of site should be available, and that depends on uiua-editor. IIRC I also faced site and uiua-editor depending on the generated files, which doesn't seem adequate for a task as simple as converting markdown to HTML.
No description provided.