-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Allow storing config in Cargo.toml #241
Comments
Interesting. A problem is the bacon.toml file is neither small nor flat. This would probably be quite ugly. Also, the need to prefix all keys would make it harder to copy paste between config files. Did you try writing a Cargo.toml file with bacon config inside to see how it would look ? |
Yes I am aware of exactly how it would look, and yes the extra prefix to the namespace adds verbosity. But "that would be ugly" sees like a subjective metric that should be left up to the end user. I'm not suggesting making it the default or taking away the current stand alone config option. I work on projects that go both ways and there are pros and cons for both. As far as Bacon's side goes all you have to do is load the TOML and query the correct namespace, then remove the prefix from everything. It shouldn't be too much trouble to implement or maintain and it lets projects manage their tooling however they want to along with many other tools that work the same way. |
Exact.
This won't be necessary if the TOML file is deserialized into the right struct. Can you build a complete example file to serve as example and as test ? |
Currently working default_job = "build"
[jobs.build]
command = [
"cargo", "build",
"--features", "luajit",
"--color", "always"
]
Proposed lines to enable the same behavior in [package.metadata.bacon]
default_job = "build"
[package.metadata.bacon.jobs.build]
command = [
"cargo", "build",
"--features", "luajit",
"--color", "always"
] |
Cargo manifests have a standardized way to store TOML data that configures third party tooling. The
[package.metadata.bacon]
space inCargo.toml
could be used to hold Bacon configs instead of a stand alonebacon.toml
file. This is supported by many developer tools that are used in Rust or Rust adjacent projects, e.g.ruff
,typos
,git-cliff
, and many more.Obviously this should be optional, but checking that key in the manifest for config data in addition to the default stand alone config location would be appreciated by projects that already have enough clutter in the project root file space and prefer to group tooling configs together.
The text was updated successfully, but these errors were encountered: