-
Notifications
You must be signed in to change notification settings - Fork 27
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
Validate dependencies and incompatibilities #91
Merged
ithinkandicode
merged 5 commits into
GodotModding:develop
from
ithinkandicode:validate-dependencies-and-incompatibilities
Feb 5, 2023
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
00990c8
validate dependencies and incompatibilities (closes #23)
ithinkandicode 24196d6
Merge branch 'develop' into validate-dependencies-and-incompatibilities
ithinkandicode 7894de6
Merge branch 'develop' into validate-dependencies-and-incompatibilities
ithinkandicode fb10b40
dependency validation: use `get_mod_id`
ithinkandicode 6c5a156
shorten `is_dependency_or_incompatibility_valid` to `is_mod_id_valid`…
ithinkandicode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
you could use the
is_name_or_namespace_valid
func if youString.split("-")
here (and checked if the array length is exactly 2)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.
I tried this originally, but it wasn't nearly as helpful. Here's the error if I use
is_name_or_namespace_valid
:And here's the error message with the approach I've used:
The 1st error tells you something is wrong with either a name or a namespace, but gives no indication of where/how to fix the problem. You don't know if it's occurring in your own mod or a dependency of it, nor whether it's an issue with the mods own name, or a dependency, or an incompatibility.
Whereas the 2nd error tells you which mod has an issue, and exactly where the issue is.
Trying to use
is_name_or_namespace_valid
initially is actually the reason I made my errors so explicitly helpful: When I was testing this I made a bunch of purposefully faulty manifests, but found that I had no idea which of them were incorrect.Better to do as much as we can to help people fix issues like this IMO.
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.
Hm, you are right. Then it might be a better idea to turn the log in
is_name_or_namespace_valid
into an error and add the log fatal like you did here once it returns false. I think that avoids having two places for id validation and the logs are still as informative, right? And don't forget to check false and log fatal after the other uses of it.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.
Maybe that would be better in a subsequent PR? I don't want to change anything beyond the scope of validating deps/incompats for this one
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 get it done with I suppose. Having two places for the same validation is not good though, that needs to change