Skip to content

Fix the default ordering of dicts and add support for sorting keys#103

Merged
sdispater merged 1 commit into
masterfrom
fix-dump-order
Jul 31, 2020
Merged

Fix the default ordering of dicts and add support for sorting keys#103
sdispater merged 1 commit into
masterfrom
fix-dump-order

Conversation

@sdispater
Copy link
Copy Markdown
Member

Resolves #93

This PR fixes an issue where the order of the original dict was not preserved when dumping it.

It also adds the ability to tell TOMLKit to sort keys when dumping by passing sort_keys=True to dumps().

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 31, 2020

Codecov Report

Merging #103 into master will decrease coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
- Coverage   91.80%   91.71%   -0.09%     
==========================================
  Files          11       11              
  Lines        2391     2391              
==========================================
- Hits         2195     2193       -2     
- Misses        196      198       +2     
Impacted Files Coverage Δ
tomlkit/api.py 98.71% <100.00%> (ø)
tomlkit/items.py 88.14% <100.00%> (ø)
tomlkit/parser.py 96.26% <0.00%> (-0.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e6a2a7...5721f88. Read the comment docs.

@sdispater sdispater merged commit c0d6f3f into master Jul 31, 2020
@sdispater sdispater deleted the fix-dump-order branch July 31, 2020 09:44
@sdispater sdispater mentioned this pull request Jul 31, 2020
capuanob pushed a commit to capuanob/tomlkit that referenced this pull request Mar 1, 2023
Fix the default ordering of dicts and add support for sorting keys
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.

Serializing OrderedDict (and dict in Python 3) does not preserve order

2 participants