Skip to content
Novus Examples
toml1.1 KB

TOML Build Configuration with Array of Tables

A build-tool configuration in TOML, chosen for the constructs YAML has no direct equivalent for: three [[build.step]] array-of-tables entries carrying an ordered pipeline, a quoted glob key, and all three TOML date-time flavours.

Preview — first 50 linestoml
# Build-tool configuration in TOML. Chosen for the places TOML and YAML disagree: TOML has no
# implicit typing surprises, dotted keys are not nesting shorthand everywhere, and arrays of
# tables are a distinct construct that YAML has no direct equivalent for.

[project]
name = "orders"
version = "1.4.0"
description = "Fictional orders service used as a build-config fixture."
requires-python = ">=3.11"
keywords = ["example", "fixture", "pipeline"]

[project.urls]
homepage = "https://example.invalid/orders"
source = "https://git.example.invalid/example-org/orders"

[build]
target = "dist"
parallel = true
jobs = 4
timeout = "30m"

[build.cache]
enabled = true
directory = ".cache/build"
max_size_mb = 2048

[[build.step]]
name = "compile"
command = "make build"
depends_on = []

[[build.step]]
name = "test"
command = "make test"
depends_on = ["compile"]

[[build.step]]
name = "package"
command = "make package"
depends_on = ["test"]

[tool.linter]
select = ["E", "F", "W"]
ignore = ["E501"]
line-length = 100

[tool.linter.per-file]
"tests/*" = ["F401"]

[dates]
54 lines total — download for the full file.

Specifications

Tables
7
Arrays Of Tables
3
Dotted Keys
true
Quoted Key
1
Offset Date Time
1
Local Date
1
Local Time
1

Testing contract

Expected to pass
Scenario
Read an ordered pipeline from a TOML array of tables and parse its date-time values
Expected result
The three [[build.step]] entries preserve declaration order with their depends_on chain intact, and released, released_at and local_time parse as local date, offset date-time and local time respectively

What is a .toml file?

TOML (Tom's Obvious Minimal Language) is a configuration format designed to be unambiguous and easy to read, with typed values, sections in bracketed tables, and clear date and number handling. It maps cleanly to hash tables. It is widely used for application and package configuration, such as Rust's Cargo and Python's pyproject.

How to use this file

Use an example TOML file to test config parsers, typed-value and table handling, and tools that read project or application settings.

How to use this file for testing

“TOML Build Configuration with Array of Tables” is a deterministic Novus Examples fixture for Config parsing, Syntax highlighting, Editor testing. TOML and INI configuration files with nested sections and typed values — for testing config parsers and loaders.

Documented properties for this file: TOML · 1,150 bytes. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Pipeline and infrastructure fixtures are inert configuration: steps reference fictional images and scripts, and nothing here executes. Run your linter, schema validator, migrator, or policy engine against them, and expect the deprecated-syntax and intentionally invalid variants to be rejected.

Point your config loader at the file and assert it reads the documented sections and typed values, including any deliberately-tricky nesting or comments.

Code examples

import tomllib

with open("build-config.toml", "rb") as f:
    data = tomllib.load(f)
print(data)

Generated by generation/pipelines.py. Free for any use, no attribution required — license.