Remix.run Logo
Spivak 3 days ago

Or you just use YAML. It's a configuration language for your software, you control which parser you use which can be YAML 1.2, you can use the safe loader which can't run untrusted code, and you're parsing the values into your language's types so any type confusion will be instantly caught.

I agree that it's not perfect but worse is better and familiar is a massive win over making your users look up a new file format or set their editor up for it. If you truly hate YAML that's fine, there's plenty of other familiar formats: INI, toml, JSON.

chromalchemy 3 days ago | parent | next [-]

YamlScript (YS) adds more programmatic expressiveness to YAML. It extends an executable Clojure runtime (non-jvm, like Babaskha). Created by YAML inventor/maintainer

https://yamlscript.org/

NeutralForest 3 days ago | parent | prev [-]

I'm just so tired of writing bash scripts inside the YAML. I want to be able to lint and test whatever goes into my pipelines and actions. Not fight shitty DX on top of whatever Azure spits out when it fails.

ksenzee 3 days ago | parent | next [-]

This is entirely understandable, and entirely the fault of whoever thought bash scripts belong in configuration files. If you’re trying to stuff a tiger into a desk drawer, the natural consequences are hardly the fault of the desk drawer.

NeutralForest 3 days ago | parent [-]

But it's the situation we're in now. It's what you see in the docs and what my colleagues write as well. I entirely agree that scripting into a markup language doesn't make sense yet the inertia is there and I wish there was some way out.

kiitos 2 days ago | parent | prev | next [-]

if you're writing bash inside of yaml then something has gone wrong well before yaml entered the picture, this is a problem with e.g. azure not with the yaml format

hk1337 3 days ago | parent | prev [-]

> I'm just so tired of writing bash scripts inside the YAML.

Why would you be doing that?

NeutralForest 3 days ago | parent [-]

Can't tell if asked honestly. Because that's how most platforms handle their pipelines. Terraform or Bicep let you use a declarative language for your platform. Everything else is calling cli commands or scripts from pipelines, written in YAML.

hk1337 3 days ago | parent [-]

I suppose I am confused by what you mean with, "writing bash scripts".

Like, are you _literally_ scripting in the value of an item or are you just equating that they are similar?

Literal being:

get_number_of_lines:

  command: >

     #!/bin/bash

     wc -l
NeutralForest 3 days ago | parent | next [-]

Something like this: https://learn.microsoft.com/en-us/azure/devops/pipelines/tas...

Invariably, ppl will write inline scripts instead of actual scripts in their own files. There are also some SDKs for most of these operations that would let you do it in code but they are not always 100% the same as the CLI, some options are different, etc.

Spivak 2 days ago | parent | prev [-]

Yes, this is how Gitlab pipelines work. It's actually easier to just inline the script most of the time than have a bucket of misc scripts lying around. Especially since you have hooks like before/after_script which would be really awkward to externalize.