-
Notifications
You must be signed in to change notification settings - Fork 701
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
Core: log warning for unknown options #1385
Conversation
So this will break things like mercenary mode yamls for alttp as they use and set "invalid" keys in the yaml. |
It marks trigger option names as valid. |
Ran this against the weights file for the big async and turned out I didn't notice that |
I am not sure if i like this, like for timespinner i can basicly use the same yaml for (that includes beta options) that works on both normal and beta. those new beta options simply wont have any effect but wont break anything either |
The point is to fail for options that were removed. While i don't think people should be removing options they're usually modified in some way so this solves that. When i was testing this with the async weights file there were about 3 options being rolled that no longer exist that wouldn't have been found otherwise. Supporting beta content is out of scope of this especially when it's just a minor convenience. |
but does it really matter? if the option is removed well it wont do a thing right? I don't think this warrants to error out |
My proposal was to introduce hidden options, and therefore give maintainers the ability to make a hidden option that errors out when set, if they want to loudly deprecate an option. I too worry this will lead to more annoyance than it's worth, personally. |
I still don't agree but it now just logs a warning for unknown options instead of crashing. |
# Conflicts: # Generate.py
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.
Briefly looked at the code, merged into main
and did functional testing, trying various methods of using triggers and options. It gave warnings only when it was supposed to. One small wording suggestion, otherwise it seems to work just fine
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
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.
Since this is now a warning, I think I'm ok merging this. If there are issues because of a case we didn't consider, we can work them out and they at least won't break anything.
For the record, this really reaffirms my belief that the Webhost should output warnings somehow.
# Conflicts: # Generate.py
* throw an error for unknown options * move the error to the end of trigger resolution and make trigger names valid * add bad hardcoded stuff for LTTP * use itertools.chain instead of a ChainMap * remove accidental unused import * make the check after both trigger resolutions so no valid keys are missed, and only check relevant game. * log a warning instead of crashing * delete options from the weights once it gets registered for cleaner erroring * grammar hard Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> --------- Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
* throw an error for unknown options * move the error to the end of trigger resolution and make trigger names valid * add bad hardcoded stuff for LTTP * use itertools.chain instead of a ChainMap * remove accidental unused import * make the check after both trigger resolutions so no valid keys are missed, and only check relevant game. * log a warning instead of crashing * delete options from the weights once it gets registered for cleaner erroring * grammar hard Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> --------- Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
Please format your title with what portion of the project this pull request is
targeting and what it's changing.
ex. "MyGame4: implement new game" or "Docs: add new guide for customizing MyGame3"
What is this fixing or adding?
title
How was this tested?
rolled seeds with valid and invalid option names
If this makes graphical changes, please attach screenshots.