#gitignore #project-template #template-generator #api-bindings #name #project #toptal

bin+lib gitignore-template-generator

A binary crate to generate templates for .gitignore files

8 releases

Uses new Rust 2024

new 0.3.4 Apr 19, 2025
0.3.3 Apr 19, 2025
0.2.1 Apr 16, 2025
0.1.0 Apr 9, 2025

#250 in Configuration

Download history 84/week @ 2025-04-04 289/week @ 2025-04-11

373 downloads per month

MIT/Apache

21KB
334 lines

gitignore-template-generator

github crates.io crates.io

A binary crate to generate templates for .gitignore files

Installation

Current release: 0.3.3

cargo install gitignore-template-generator

Usage

Available options:

$ gitignore-template-generator --help
Usage: gitignore-template-generator [OPTIONS] <TEMPLATE_NAMES>...

Generate templates for .gitignore files

Arguments:
  <TEMPLATE_NAMES>...  A non-empty list of existing gitignore template names

Options:
  -a, --author   Print author
  -h, --help     Print help
  -V, --version  Print version

Version: 0.3.3
Author: Patacode <pata.codegineer@gmail.com>

Examples:

Generate a gitignore template for simple rust projects and store it in a file named .gitignore:

$ gitignore-template-generator rust > .gitignore
$ cat .gitignore
# Created by https://www.toptal.com/developers/gitignore/api/rust
# Edit at https://www.toptal.com/developers/gitignore?templates=rust

### Rust ###
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# End of https://www.toptal.com/developers/gitignore/api/rust

Development

Install cargo-make, dev tools and build the package:

./bootstrap.sh

Run the tests:

cargo test # unit + integration tests
cargo test --lib # unit tests
cargo test --test integration_tests # integration tests

Generate code coverage report in HTML format under target/tarpaulin:

cargo tarpaulin \
  --out Html \
  --exclude-files src/lib.rs src/main.rs benches/* tests/* \
  --output-dir target/tarpaulin

Benchmark binary and library crates:

cargo bench

License

Licensed under either of

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 license, shall be dual-licensed as above, without any additional terms or conditions.

Dependencies

~11–19MB
~342K SLoC