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

test(yaml): test sortKeys option behavior #5523

Merged
merged 3 commits into from
Jul 24, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Jul 23, 2024

This PR adds test cases that check the behavior of sortKeys option of stringify.

@github-actions github-actions bot added the yaml label Jul 23, 2024
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.46%. Comparing base (ff2f1f1) to head (51fbc6e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5523      +/-   ##
==========================================
+ Coverage   96.44%   96.46%   +0.01%     
==========================================
  Files         465      465              
  Lines       37714    37714              
  Branches     5573     5574       +1     
==========================================
+ Hits        36374    36380       +6     
+ Misses       1298     1291       -7     
- Partials       42       43       +1     

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

Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

I don't see a good reason for YAML to handle this functionality. Rather, this seems like something that should be done to the data before stringification. In other words, I suggest removing this option. WDYT?

@kt3k
Copy link
Member Author

kt3k commented Jul 23, 2024

The key order of Object is not easily controllable in JavaScript (Even inconsistent across runtimes). See the discussion in https://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order

@kt3k kt3k merged commit 9679f73 into denoland:main Jul 24, 2024
15 checks passed
@kt3k kt3k deleted the test-yaml-stringify-sort-keys branch July 24, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants