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

feat(p/ufmt): Support more formatting verbs #2351

Merged
merged 6 commits into from
Oct 2, 2024

Conversation

notJoon
Copy link
Member

@notJoon notJoon commented Jun 13, 2024

Description

Support for several new formatting verbs to the ufmt package:

%x: Outputs byte values as hexadecimal strings. Supports uint8, []uint8, and [32]uint8 types.
%q: Outputs quoted strings with proper escaping. Supports string type.
%T: Outputs the type of the value. Supports various built-in types using type switching with interface{}.

Particularly in the case of byte slices, previously need to use a loop to convert each element to a string one by one, but now there is no need for that anymore.

@notJoon notJoon requested review from a team as code owners June 13, 2024 10:14
@notJoon notJoon requested review from thehowl and ltzmaxwell and removed request for a team June 13, 2024 10:14
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Jun 13, 2024
Copy link
Contributor

@mvertes mvertes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, except a minor simplification.

examples/gno.land/p/demo/ufmt/ufmt.gno Outdated Show resolved Hide resolved
Co-authored-by: Marc Vertes <mvertes@free.fr>
Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good, please merge master and fix ci.

@zivkovicmilos
Copy link
Member

Pinging @notJoon for visibility

Copy link

codecov bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.91%. Comparing base (fb85d0c) to head (333257b).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2351   +/-   ##
=======================================
  Coverage   60.91%   60.91%           
=======================================
  Files         564      564           
  Lines       75273    75273           
=======================================
+ Hits        45851    45855    +4     
+ Misses      26052    26047    -5     
- Partials     3370     3371    +1     
Flag Coverage Δ
contribs/gnodev 60.65% <ø> (-0.82%) ⬇️
contribs/gnofaucet 14.46% <ø> (ø)
gno.land 67.17% <ø> (ø)
gnovm 65.77% <ø> (ø)
misc/genstd 80.54% <ø> (ø)
misc/logos 20.23% <ø> (ø)
tm2 62.08% <ø> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@notJoon
Copy link
Member Author

notJoon commented Oct 2, 2024

@zivkovicmilos fixed!

@thehowl thehowl merged commit 11a5027 into gnolang:master Oct 2, 2024
119 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants