foundry
foundry copied to clipboard
writeToml should keep original formatting
Component
Forge
Describe the feature you would like
Current behavior
Toml file:
key1 = "1"
# this is key2
key2 = "2"
Script:
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.8.24;
import {Script, console} from "forge-std/Script.sol";
contract TomlTest is Script {
function run() public {
vm.writeToml("abcd", "test.toml", ".key2");
}
}
Resulting toml file, after running forge script scripts/foundry/TomlTest.s.sol:TomlTest
:
key1 = "1"
key2 = "abcd"
Desired behavior
writeToml
should maintain the original formatting (line breaks, comments):
key1 = "1"
# this is key2
key2 = "abcd"
Additional context
No response