Skip to content
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

Raise informative exception when metadata is unresolved in a metadata-based match #757

Merged
merged 4 commits into from
Aug 29, 2022

Conversation

MapleCCC
Copy link
Contributor

I also tuned the related unit test to accommodate this change.

This PR closes #526.

…-based match, instead of silently hide potential errors
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 27, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 27, 2022

Codecov Report

Merging #757 (5e5692f) into main (a077104) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #757   +/-   ##
=======================================
  Coverage   94.81%   94.81%           
=======================================
  Files         247      247           
  Lines       25802    25809    +7     
=======================================
+ Hits        24465    24472    +7     
  Misses       1337     1337           
Impacted Files Coverage Δ
libcst/matchers/_matcher_base.py 91.30% <100.00%> (ø)
libcst/matchers/tests/test_findall.py 97.10% <100.00%> (ø)
...bcst/matchers/tests/test_matchers_with_metadata.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@zsol
Copy link
Member

zsol commented Aug 28, 2022

The change looks great, thanks! Mind adding a quick note about this exception to the docs?

@MapleCCC
Copy link
Contributor Author

Okay, in the new commit I documented this behavior to MatchMetadata and MatchMetadataIfTrue. 📚

@zsol zsol merged commit 27aa23f into Instagram:main Aug 29, 2022
@zsol
Copy link
Member

zsol commented Aug 29, 2022

Nice :)

@MapleCCC MapleCCC deleted the raise-on-unresolved-metadata branch August 29, 2022 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The example code in document of MatchMetadataIfTrue doesn't work as expected
4 participants