bazel-lib
bazel-lib copied to clipboard
[FR]: Support `filter_file` in `assert_json_matches`
What is the current behavior?
Only string-literal filters can be passed to assert_json_matches, but jq() supports using files.
Describe the feature
Change the signature to:
assert_json_matches(name, file1, file2, filter1 = ".", filter2 = ".", filter_file1 = None, filter_file2 = None, **kwargs):
I'm happy to send a PR if you'd like; please assign the Issue to me if you agree that this is a worthwhile feature.
One problem will be incompatibility between the filter and filter_file args. Thoughts on having filter_file override filter i.f.f. filter == "."? This maintains backwards compatibility while avoiding ambiguity if both are set.
Sorry for the delay @aschlosberg - your proposal sounds good to me.