-
-
Notifications
You must be signed in to change notification settings - Fork 264
fix(template): correctly serialize JSON for the commit fields #1145
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
Conversation
|
Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️ |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1145 +/- ##
==========================================
+ Coverage 40.04% 40.23% +0.20%
==========================================
Files 21 21
Lines 1911 1914 +3
==========================================
+ Hits 765 770 +5
+ Misses 1146 1144 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Shingo OKAWA <shingo.okawa.g.h.c@gmail.com>
Signed-off-by: Shingo OKAWA <shingo.okawa.g.h.c@gmail.com>
Signed-off-by: Shingo OKAWA <shingo.okawa.g.h.c@gmail.com>
orhun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat, thanks for your contribution!
|
Congrats on merging your first pull request! ⛰️ |
|
Thank you for providing this wonderful crate @orhun ! |
Description
Fixes inconsistent
serde_json::Valuestring representations when applying regex matchers. Specifically, it ensures that:Value::Stringdoes not include surrounding quotes,Number,Bool,Null) are stringified appropriately,ObjectandArrayare treated as unsupported and result in an error.Closes #1143
Motivation and Context
Previously,
serde_json::Value::String("example")was converted usingto_string(), resulting in"\"example\"", which broke regex patterns expecting plain strings. This PR fixes that by:Value::String,to_string()toNumber,Bool, andNull,ObjectorArray.This makes pattern matching robust and predictable when working with JSON input from commit metadata or remote PR context.
How Has This Been Tested?
Commit::parseto verify field-based parsing logic using bothauthorandremoteattributes.commit_parsersconfiguration incliff.toml:Screenshots / Logs (if applicable)
N/A
Types of Changes
Checklist: