Configuration Syntax¶
The configuration language of jaffle.hcl
is HCL (HashiCorp Configuration Language).
The top-level of the configuration can have the following items:
Example¶
kernel "py_kernel" {}
app "watchdog" {
class = "jaffle.app.watchdog.WatchdogApp"
kernel = "py_kernel"
logger {
level = "info"
}
options {
handlers = [{
watch_path = "my_module"
patterns = ["*.py"]
ignore_directories = true
functions = ["pytest.handle_watchdog_event({event})"]
}]
}
}
app "pytest" {
class = "jaffle.app.pytest.PyTestRunnerApp"
kernel = "py_kernel"
logger {
level = "info"
}
options {
args = ["-s", "-v", "--color=yes"]
auto_test = [
"my_module/tests/test_*.py",
]
auto_test_map {
"my_module/**/*.py" = "my_module/tests/{}/test_{}.py"
}
}
}
JSON¶
Since JSON is a valid HCL, you can also write the configuration file as JSON. The previous HCL example is same as the following JSON.
{
"kernel": {
"py_kernel": {}
},
"app": {
"watchdog": {
"class": "jaffle.app.watchdog.WatchdogApp",
"kernel": "py_kernel",
"logger": {
"level": "info"
},
"options": {
"handlers": [
{
"watch_path": "my_module",
"patterns": [
"*.py"
],
"ignore_directories": true,
"functions": [
"pytest.handle_watchdog_event({event})"
]
}
]
}
},
"pytest": {
"class": "jaffle.app.pytest.PyTestRunnerApp",
"kernel": "py_kernel",
"logger": {
"level": "info"
},
"options": {
"args": [
"-s",
"-v",
"--color=yes"
],
"auto_test": [
"my_module/tests/test_*.py"
],
"auto_test_map": {
"my_module/**/*.py": "my_module/tests/{}/test_{}.py"
}
}
}
}
}