feat: error if configuration file has unknown properties #1249
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.
Currently the scanner does not check if there were unrecognized properties when loading configuration files, meaning that typos can easily slip through; to help avoid this, I've modified
tryLoadConfig
to return an error if there are any undecoded keys in the metadata.While this could cause existing configs to start erroring, I don't think this should be considered a breaking change as such configurations would inherently causing different behaviour than what was desired and thus be a downstream bug themselves.
This will also mean that old versions of the scanner going forward would not be compatible with configs for even newer versions of the scanner that introduce new config properties, which is could be a little annoying but I don't think outweighs the benefit of this validation especially given such configurations likewise would result in different behaviour since the old scanner version would not know what to do with the new configuration option.
Resolves #1098