diff options
| author | Jimmy Yuen Ho Wong <wyuenho@users.noreply.github.com> | 2025-07-24 18:14:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-24 10:14:43 -0700 |
| commit | 7dd0c477231165535beba267ff734b6918385cb6 (patch) | |
| tree | 0b3bdcbb162442c3016949173f1a491357298ba6 /test | |
| parent | 20498e941b61231370d31b0fac64cd723089ce78 (diff) | |
Add taplo for formatting TOML files (#373)
Taplo is a very popular formatter and linter for TOML.
https://github.com/tamasfe/taplo
Diffstat (limited to 'test')
| -rw-r--r-- | test/formatters/installers/taplo.bash | 1 | ||||
| -rw-r--r-- | test/formatters/samplecode/taplo/in.toml | 33 | ||||
| -rw-r--r-- | test/formatters/samplecode/taplo/out.toml | 30 |
3 files changed, 64 insertions, 0 deletions
diff --git a/test/formatters/installers/taplo.bash b/test/formatters/installers/taplo.bash new file mode 100644 index 0000000..a7dc7f6 --- /dev/null +++ b/test/formatters/installers/taplo.bash @@ -0,0 +1 @@ +npm install -g @taplo/cli diff --git a/test/formatters/samplecode/taplo/in.toml b/test/formatters/samplecode/taplo/in.toml new file mode 100644 index 0000000..175515a --- /dev/null +++ b/test/formatters/samplecode/taplo/in.toml @@ -0,0 +1,33 @@ +# This is a TOML document. + +title = "TOML Example" + +[owner] +name = "Tom Preston-Werner" +dob = 1979-05-27T07:32:00-08:00 # First class dates + +[database] +server = "192.168.1.1" +ports = [ 8000, 8001, 8002 ] +connection_max = 5000 +enabled = true + +[servers] + + # Indentation (tabs and/or spaces) is allowed but not required + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + +[clients] +data = [ ["gamma", "delta"], [1, 2] ] + +# Line breaks are OK when inside arrays +hosts = [ + "alpha", + "omega" +] diff --git a/test/formatters/samplecode/taplo/out.toml b/test/formatters/samplecode/taplo/out.toml new file mode 100644 index 0000000..77669bd --- /dev/null +++ b/test/formatters/samplecode/taplo/out.toml @@ -0,0 +1,30 @@ +# This is a TOML document. + +title = "TOML Example" + +[owner] +name = "Tom Preston-Werner" +dob = 1979-05-27T07:32:00-08:00 # First class dates + +[database] +server = "192.168.1.1" +ports = [8000, 8001, 8002] +connection_max = 5000 +enabled = true + +[servers] + +# Indentation (tabs and/or spaces) is allowed but not required +[servers.alpha] +ip = "10.0.0.1" +dc = "eqdc10" + +[servers.beta] +ip = "10.0.0.2" +dc = "eqdc10" + +[clients] +data = [["gamma", "delta"], [1, 2]] + +# Line breaks are OK when inside arrays +hosts = ["alpha", "omega"] |
