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

Add escape_strings option to PrettyConfig #426

Merged
merged 1 commit into from
Oct 21, 2022

Conversation

juntyr
Copy link
Member

@juntyr juntyr commented Oct 21, 2022

This PR adds an escape_strings option to PrettyConfig that is enabled by default. When enabled, strings are serialised using escapes. When disabled, strings that contain no " are serialised literally. If the string does contain a ", a raw string literal with the minimum number of required leading # is emitted.

This feature was suggested in #425, i.e. this PR fixes #425.

  • I've included my change in CHANGELOG.md

@codecov-commenter
Copy link

Codecov Report

Base: 87.22% // Head: 86.73% // Decreases project coverage by -0.48% ⚠️

Coverage data is based on head (5add5bd) compared to base (27d2de4).
Patch coverage: 81.44% of modified lines in pull request are covered.

❗ Current head 5add5bd differs from pull request most recent head 1a31674. Consider uploading reports for the commit 1a31674 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #426      +/-   ##
==========================================
- Coverage   87.22%   86.73%   -0.49%     
==========================================
  Files          58       59       +1     
  Lines        7145     7281     +136     
==========================================
+ Hits         6232     6315      +83     
- Misses        913      966      +53     
Impacted Files Coverage Δ
src/ser/mod.rs 71.39% <64.70%> (-3.80%) ⬇️
tests/425_escape_strings.rs 100.00% <100.00%> (ø)
src/parse.rs 92.55% <0.00%> (+0.47%) ⬆️

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@juntyr
Copy link
Member Author

juntyr commented Oct 21, 2022

These codecov results again make no sense. At some point I will need to investigate how to get them to be more stable, as on some weeks it works perfectly, and on some lines without code are marked as not covered :/

@juntyr
Copy link
Member Author

juntyr commented Oct 21, 2022

Though I did notice that I introduced three uncovered test lines in #424 ...

@juntyr
Copy link
Member Author

juntyr commented Oct 21, 2022

?r @torkleyy

@juntyr juntyr requested a review from torkleyy October 21, 2022 08:02
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@torkleyy torkleyy left a comment

Choose a reason for hiding this comment

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

❤️

@juntyr juntyr merged commit e06dc75 into ron-rs:master Oct 21, 2022
@juntyr juntyr deleted the 425-escape-strings branch October 21, 2022 09:38
juntyr added a commit to juntyr/ron that referenced this pull request Feb 6, 2023
juntyr added a commit to juntyr/ron that referenced this pull request Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pretty Print Multiline String
4 participants