-
-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
PR welcomeUser contribution/PR is welcomeUser contribution/PR is welcomeenhancementNew feature or requestNew feature or request
Description
When loading in a TOML file and making sure to have sane defaults in the code for any keys that are missing, Tomlyn will apply the whitespace of the first known element to the current element, and then not apply it to the element it was read from. This subsequently has funky effects on the remainder of the output.
# This is the input file
[db.maria]
database = "Foo"
load_balance = "LeastConnections"
password = "ENV:SUPER_SEKRIT"
port = 3306
protocol = "Socket"
server = "db.local.net"
user = "Who knows"
[db.maria.misc]
cancellation_timeout = 15
connection_timeout = 60
[db.maria.ssl]
ssl_mode = "Preferred"
[db.maria.pooling]
connection_idle_timeout = 100
connection_life_time = 0
connection_reset = true
dns_check_interval = 0
maximum_pool_size = 15
minimum_pool_size = 1
pooling = true
Gets mangled into (verbatim copy-pasted from serializing and printing TOML)
[db.maria]
database = "Foo"
load_balance = "LeastConnections"
password = "ENV:SUPER_SEKRIT"
port = 3306
protocol = "Socket"
server = "db.local.net"
user = "Who knows"
[db.maria.misc]
cancellation_timeout = 15
connection_timeout = 60
[db.maria.pooling]
connection_idle_timeout = 100
connection_life_time = 0
connection_reset = true
dns_check_interval = 0
maximum_pool_size = 15
minimum_pool_size = 1
pooling = true
[db.maria.ssl]
ssl_mode = "Preferred"
Metadata
Metadata
Assignees
Labels
PR welcomeUser contribution/PR is welcomeUser contribution/PR is welcomeenhancementNew feature or requestNew feature or request