gitignore-template-generator

Crates.iogitignore-template-generator
lib.rsgitignore-template-generator
version
sourcesrc
created_at2025-04-09 21:33:26.351125+00
updated_at2025-05-19 21:25:50.056249+00
descriptionA binary crate to generate templates for .gitignore files
homepage
repositoryhttps://github.com/Patacode/gitignore-template-generator
max_upload_size
id1627341
Cargo.toml error:TOML parse error at line 27, column 1 | 27 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Maximilien Ballesteros (Patacode)

documentation

https://docs.rs/crate/gitignore-template-generator

README

gitignore-template-generator

github crates.io crates.io

A binary crate to generate templates for .gitignore files

Installation

Current release: 0.10.0

cargo install gitignore-template-generator

Usage

Available options:

Usage: gitignore-template-generator [OPTIONS] [TEMPLATE_NAMES]...

Generate templates for .gitignore files

Arguments:
  [TEMPLATE_NAMES]...  A non-empty list of gitignore template names

Options:
  -c, --check                          Enable robust template names check
  -g, --generator-uri <GENERATOR_URI>  The template generator uri [default: /developers/gitignore/api]
  -l, --list                           List available templates
  -i, --lister-uri <LISTER_URI>        The template lister uri [default: /developers/gitignore/api/list]
  -s, --server-url <SERVER_URL>        The template manager url [default: https://www.toptal.com]
  -t, --timeout <TIMEOUT>              The template generation and listing service calls timeout [default: 5s/5000ms]
  -u, --timeout-unit <TIMEOUT_UNIT>    The timeout unit [default: second] [possible values: millisecond, second]
  -h, --help                           Print help
  -V, --version                        Print version
  -a, --author                         Print author

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

The cli tool binds to any template manager service able to manage templates over HTTP. It defaults to toptal template manager, using https://www.toptal.com/developers/gitignore/api/{templateNames} to generate templates (with {templateNames} being a comma-separated list of template names), and https://www.toptal.com/developers/gitignore/api/list to list them.

It is possible to provide a custom template manager service to the cli tool. One can easily change the template manager service base url and related endpoint uris using the server-url, generator-uri and lister-uri options.

Examples:

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

gitignore-template-generator rust > .gitignore

Generate a gitignore template for python projects using a custom generator (a fictive one here just for the example)

gitignore-template-generator python \
  --server-url https://myapis.foobar.com
  --generator-uri /gitignore/generate

List available templates

gitignore-template-generator --list

Development

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

./bootstrap.sh

Run the tests:

cargo test # unit + isolation + integration tests
cargo test --lib # unit tests
cargo test --test isolation_tests # isolation 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.

Commit count: 0

cargo fmt