Harden the configuration system to be easier to use and harder to misuse#298
Merged
Harden the configuration system to be easier to use and harder to misuse#298
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reworks the configuration API to fix a set of correctness, safety, and usability issues identified during a code review of the configuration system. The changes flatten the previously two-level config class hierarchy, rename ambiguous field names, make both config classes immutable, eliminate shared mutable state on the
ContextVardefault, and replace the**kwargs-basedconfigure()/with_config()API with explicit typed keyword-only parameters.Changed
disable_warningstodisable_validation_warningsdisable_warning_severitytodisable_fhir_warningsdisable_errorstodisable_fhir_errorsdisabled_constraintstodisabled_fhir_constraintswith_config()context manager tooverride_config()for clarity and consistencyFhircraftConfigto raise an error upon direct attribute mutationFhircraftConfigAPI and removeValidationConfigreferencesFixed
**kwargsinconfigure()andoverride_config()with explicit keyword-only typed parameters; unrecognized arguments now raiseTypeErrorat call time. Fixes # Global config functions are not type-safe or IDE-friendly #208Removed
ValidationConfigdataclass — fields merged directly intoFhircraftConfig_build_validation_config()helper — no longer needed after the API redesignValidationConfigandFhircraftConfigfromfhircraft.__init__lazy-import exports