Skip to content

Configuration File Format

Myles edited this page Feb 8, 2019 · 1 revision

File Format

The configuration files all use Tom's Obvious, Minimal Language (TOML) format specification, this enables very simple and concise configuration files.

An excerpt from a TOML file below explains the basic syntax.

# This is comment because the line starts with a '#'
# This is a TOML document.

# Key Value pairs
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 = [ 8001, 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"

# Line breaks are OK when inside arrays
hosts = [
  "alpha",
  "omega"
]

Checks & TOML

Putting what we now know together, we can form the basic format for a configuration file.

[variable_config.odd_characters]
setting = ["!", "#", "  ", "@", "ë", "ç", "ô", "ü"]
desc = "Variable names and labels cannot contain certain 'odd' characters."

[variable_config.label_max_length]
setting = 79
desc = "Variable labels should not exceed a max length"

# Eliding or commenting a check from the config has the effect of removing it from the output.
# [value_config.label_max_length]
# setting = 79
# desc = "Value labels should not exceed a max length"
Clone this wiki locally