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

Do not validate .model.json files with no content/whitespace only #420

Merged
merged 8 commits into from
May 14, 2021

Conversation

Mixu78
Copy link
Contributor

@Mixu78 Mixu78 commented May 2, 2021

Closes #415

@Mixu78 Mixu78 requested a review from Kampfkarren May 3, 2021 04:58
Copy link
Contributor

@LPGhatguy LPGhatguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! Left some comments.

We should also add a test for this; you can see how tests are written here. Add a project with an empty .model.json file in it, assert that the tree looks correct, then write to the file with a new, valid .model.json. After the change registers, assert that the new tree looks correct.

src/snapshot_middleware/json_model.rs Outdated Show resolved Hide resolved
src/change_processor.rs Outdated Show resolved Hide resolved
src/snapshot_middleware/mod.rs Outdated Show resolved Hide resolved
@Mixu78 Mixu78 requested a review from LPGhatguy May 7, 2021 16:34
@LPGhatguy LPGhatguy merged commit ca8865a into rojo-rbx:master May 14, 2021
Dekkonot pushed a commit to UpliftGames/rojo that referenced this pull request Jan 11, 2024
…jo-rbx#420)

* Ignore empty/whitespace-only model.json files

* Ignore no return value from model.json files during snapshot

* Use str::from_utf8 instead of String::from_utf8

* Revert "Ignore no return value from model.json files during snapshot"

This reverts commit 0aef16e.

* Add test for empty .model.json files

* Change empty .model.json check method

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>

* Format code with cargo fmt

* Use raw string instead

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only validate .model.json files after content has been added
3 participants