rust-workspaced
Generate .gitignore files from a declarative TOML specification.
Status
This crate is a name reservation. Version 0.0.0 claims the name on
crates.io; it contains no working API and nothing useful to depend on yet.
Please do not add it as a dependency. The version will move off 0.0.0 when
there is something real to ship, and this README will say so.
Why
A .gitignore is an append-only pile of patterns. Entries accumulate, nobody
remembers which tool needed **/.cargo-vet or whether /target is still load
bearing, and the same block gets copy-pasted between repositories where it
slowly drifts out of sync.
rust-workspaced treats the file as generated output. Patterns live in TOML with the
reasoning attached, grouped into named sections, and the .gitignore is
rendered from that — so the source of truth is reviewable and the output is
reproducible.
How it works
Describe the sections and rules in rust-workspaced.toml:
= 1
[[]]
= 3
= "Rust"
= "Cargo Ignores"
[[]]
= ["/target"]
[[]]
= "Cargo Package"
= ["**/dist"]
[[]]
= "Cargo Vet"
= ["**/.cargo-vet"]
Which renders to .gitignore:
### Rust
# Cargo Ignores
/target
# Cargo Package
**/dist
# Cargo Vet
**/.cargo-vet
A section's name becomes a heading at the given level, each note becomes
the comment introducing its rule, and ignore carries the patterns themselves.
Every entry keeps the note explaining why it is there.
Licence
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 licence, shall be dual licensed as above, without any additional terms or conditions.