-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config file: Which format? #395
Comments
Another option is justception: Just's config file IS A JUSTFILE. By adding a |
I'm a big fan of YAML. I like the idea of using a Justfile as config as well but |
Also please consider https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html so I don't have to put yet another hidden config file in my home directory. 👼 |
XDG base directory support is definitely a must have! |
BTW, YAML is a superset of JSON. So if you support reading YAML you get reading JSON for free. Not that I'd ever use JSON personally but for those who like to generate their config files JSON is supported by almost every language in common usage. |
@passcod adopted KDL as a configuration language for watchexec's incoming developments. |
Personally, I've wanted to use TOML to set variables that are used in my justfiles. This is because my programs often use a toml file for configuration and read from it to run programs. The only way I know to load external variables in just right now is environment variables stored in In a very hacky manner, I've created my own python script that converts
This way I'm always rewriting All that's to say, I think the ability to import other configuration files would be helpful, for either variables or configuration options. And at the end of the day, no matter what solution you pick, there's always a tool that can convert between toml/json/yaml anyway (like yj for example) and users can just do that if they don't like the input format for justfile configs. I'm partial to TOML, obviously. |
toml is probably the worst of all solutions, given how fragile arrays are in it. See #395 (comment) for more. |
I understand why people find some cons to Yaml due to the mandatory indentation, however, this IMO the format that makes more sense to users:
|
I'm considering adding a user config file to just. Rust and serde make it so simple to do that it seems like a no brainer.
I'm not entirely sure which format to use. I think reasonable possibilities are TOML, YAML, JSON, and just. I personally find JSON too verbose and fiddly, so I'm going to veto that.
TOML is common in the rust ecosystem and very straightforward, but is slightly verbose. YAML, on the other hand, is a bit less verbose and handles nested keys better, but can be trickier to write. Using a justfile as the config file would allow including recipes, and make configuration on a per-user and per-justfile basis uniform.
How do others feel about this? Add a ❤️for TOML, 🚀 for YAML, and 😄 for just; and add a comment if you have a perspective you'd like to share.
The first config option I'm thinking of supporting is something that turns off line-echoing by default. I've been analyzing all the public
justfile
s on github, and making recipes quiet, i.e. prefixing them with a@
, gets a lot of use. I like echoing lines by default, but it looks like a lot of other people prefer most recipes to be quiet. So, adding a.justrc
and making the default configurable seems like a good idea.(This was first suggested way back in #246 by @Fleshgrinder, but it didn't strike me to add a config option, so users could decide individually.)
Edit: Added just as potential format.
The text was updated successfully, but these errors were encountered: