-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from jonathangreen/feature/sort-everything
Add the ability to sort inline tables and inline arrays
- Loading branch information
Showing
13 changed files
with
596 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
[b] | ||
blist=[ 'c', 'a', 'b'] # Comment | ||
alist = [ | ||
'g', | ||
|
||
|
||
|
||
# Comment attached | ||
'w', # Comment inline | ||
|
||
# Orphan comment | ||
|
||
#Multiline | ||
# Second attached comment | ||
'a' | ||
|
||
] | ||
'aalist' = { c="test", a= "another test" }#list comment | ||
# Multilevel inline array | ||
aaalist = [ | ||
[ | ||
{ name="Homer Simpson", town ="Springfield"} | ||
], | ||
[ | ||
{ name="Bart Simpson", town ="Springfield"} | ||
], | ||
# Weird block comment | ||
[ | ||
# Another weird block comment | ||
{name="Lisa Simpson", town ="Springfield", a-test = "Did this sort?"}#Should get sorted | ||
], | ||
] | ||
[a] | ||
test = [ | ||
{x = [ | ||
"foo", | ||
"bar" | ||
], a = [ | ||
"" | ||
]}, | ||
{y = [ | ||
"foo", | ||
"baz" | ||
]} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[a] | ||
test = [ | ||
{x = [ | ||
"foo", | ||
"bar" | ||
], a = [ | ||
"" | ||
]}, | ||
{y = [ | ||
"foo", | ||
"baz" | ||
]} | ||
] | ||
|
||
[b] | ||
blist = ['c', 'a', 'b'] # Comment | ||
alist = [ | ||
'g', | ||
# Comment attached | ||
'w', # Comment inline | ||
# Multiline | ||
# Second attached comment | ||
'a' | ||
] | ||
'aalist' = {c = "test", a = "another test"} # list comment | ||
# Multilevel inline array | ||
aaalist = [ | ||
[ | ||
{name = "Homer Simpson", town = "Springfield"} | ||
], | ||
[ | ||
{name = "Bart Simpson", town = "Springfield"} | ||
], | ||
# Weird block comment | ||
[ | ||
# Another weird block comment | ||
{name = "Lisa Simpson", town = "Springfield", a-test = "Did this sort?"} # Should get sorted | ||
] | ||
] |
33 changes: 33 additions & 0 deletions
33
tests/examples/sorted/inline-no-comments-no-table-sort.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[b] | ||
aaalist = [ | ||
[ | ||
{a-test = "Did this sort?", name = "Lisa Simpson", town = "Springfield"}, | ||
], | ||
[ | ||
{name = "Bart Simpson", town = "Springfield"}, | ||
], | ||
[ | ||
{name = "Homer Simpson", town = "Springfield"}, | ||
], | ||
] | ||
'aalist' = {a = "another test", c = "test"} | ||
alist = [ | ||
'a', | ||
'g', | ||
'w', | ||
] | ||
blist = ['a', 'b', 'c'] | ||
|
||
[a] | ||
test = [ | ||
{a = [ | ||
"", | ||
], x = [ | ||
"bar", | ||
"foo", | ||
]}, | ||
{y = [ | ||
"baz", | ||
"foo", | ||
]}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[a] | ||
test = [ | ||
{a = [ | ||
"" | ||
], x = [ | ||
"bar", | ||
"foo" | ||
]}, | ||
{y = [ | ||
"baz", | ||
"foo" | ||
]} | ||
] | ||
|
||
[b] | ||
# Multilevel inline array | ||
aaalist = [ | ||
# Weird block comment | ||
[ | ||
# Another weird block comment | ||
{a-test = "Did this sort?", name = "Lisa Simpson", town = "Springfield"} # Should get sorted | ||
], | ||
[ | ||
{name = "Bart Simpson", town = "Springfield"} | ||
], | ||
[ | ||
{name = "Homer Simpson", town = "Springfield"} | ||
] | ||
] | ||
'aalist' = {a = "another test", c = "test"} # list comment | ||
alist = [ | ||
# Multiline | ||
# Second attached comment | ||
'a', | ||
'g', | ||
# Comment attached | ||
'w' # Comment inline | ||
] | ||
blist = ['a', 'b', 'c'] # Comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.