-
Notifications
You must be signed in to change notification settings - Fork 251
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
Implement optional strict
mode
#126
Comments
I'm working on this now! ⛑ |
@mwear here's the write-up for the strict mode as we discussed today. |
Is the amount of overhead required to maintain strict mode too much to make this worthwhile right now? The user facing api is fairly substantial and seems to be changing a lot, if the spec was very stable I think it would make more sense to think about doing this, but I would vote for waiting till at least a 1.0 release |
👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
Overview
We recently removed runtime checks from the API and the SDK. During the SIG meeting on October 16, 2019, we discussed the value of having a
strict
mode for the library. We believe there is value in having an optional strict mode where a runtime flag can be enabled that raises helpful errors for the developer/environment.Rationale
The error handling spec states that implementations MUST NOT throw unhandled exceptions at run time with more to say regarding performance and options. Additionally, the spec mentions that an implementation can implement a strict mode.
What needs doing
Strict
modules inline with classes that have optional strict checksStrict
modules to the classes when the flag is enabledExamples / Prior Art
Global flag
OJ has a
default_options
configuration settiong which allows the user to set the mode. As we don't have multiple modes perhaps this is overkill.or
Strict modules
The current idea is to keep the strict definitions close to the API/SDK classes and methods. Moving the
Strict
module into the class that requires the optional checks means it's easier to discover and maintain.Testing
Wiring it up
Provide a global method that knows what classes have
Strict
modules and can prepend those modules. The module definition may need to change so we can register what modules need to be enabled/wired up. Note: this is very much a WIP.And somewhere else:
The text was updated successfully, but these errors were encountered: