3 ms·
Seems to me that YAML just needs type/schema support to be less of a hurdle. As an alternative, the encoding/decoding roundtrip using protobuf seems reasonable
by matja 5y ago
Seems to me that YAML just needs type/schema support to be less of a hurdle.
As an alternative, the encoding/decoding roundtrip using protobuf seems reasonable to me, catches the footgun of using floating-point version numbers (it becomes a parse error), whitespace/multiline concatenation being more obvious, and allowing comments (compared to JSON):
( cat << EOF
# yes, comments are allowed
name: "Python package"
on: "push"
build {
python_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
steps: [
{
name: "Install dependencies"
run:
"python -m pip install --upgrade pip\n"
"pip install pytest\n"
"if [ -f 'requirements.txt' ]; then pip install -r requirements.txt; fi\n"
},
{
name: "Test with pytest"
run: "pytest\n"
}
]
}
EOF
) | protoc --encode=Config config.proto | protoc --decode=Config config.proto
name: "Python package"
on: "push"
build {
python_version: "3.6"
python_version: "3.7"
python_version: "3.8"
python_version: "3.9"
python_version: "3.10"
steps {
name: "Install dependencies"
run: "python -m pip install --upgrade pip\npip install pytest\nif [ -f \'requirements.txt\' ]; then pip install -r requirements.txt; fi\n"
}
steps {
name: "Test with pytest"
run: "pytest\n"
}
}
- elurg 5y ago> Seems to me that YAML just needs type/schema support to be less of a hurdle. JSON schemas exist and can be applied to yaml and this is supported by many editors. For example this vscode extension: https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml https://marketplace.visualstudio.com/items?itemName=redhat.v... It's strange to see so many complains about "missing tooling" that actually exists and is well supported.
- rurban 5y ago> Seems to me that YAML just needs type/schema support to be less of a hurdle. Unfortunately YAML already got type support, which made it easier to roundtrip, but also insecure. Creating a type calls constructors with possible insecure side effects. Which was eg used to hack Movable Type.