Remix.run Logo
wofo 3 days ago

Hmmm that's interesting. KSON actually shows a warning when there's misleading indentation, exactly to prevent this sort of thing! It seems like the detection logic only considers indents after a new line, so it doesn't complain in this case. I just opened an issue to see if things can be tightened up a bit (https://github.com/kson-org/kson/issues/221).

To see misleading indentation warnings in action, you can try the following snippet in the playground (https://kson.org/playground/) and will properly get a warning:

    ports:
       - 80
       - 8000
         - 10000
       - 12000
       - 14000
Next to that, note that KSON already has an autoformatter, which also helps prevent misleading indentation in files.
theamk 2 days ago | parent [-]

It's config file - I might be editing with "sudo vi", possibly inside docker container, possibly on remote server with awkward connection procedure. Or maybe it'll get generated via some templating mechanism by terraform rules. Or embedded in the code.

If your config format requires autoformatter and/or linter to detect trivial mistakes, it is junk.

wofo 13 hours ago | parent [-]

> If your config format requires autoformatter and/or linter to detect trivial mistakes, it is junk.

IMO this way of thinking disqualifies lots of legitimate configuration formats, but to each their own I guess.