Gitignores
GitHub’s collection of gitignores, embedded, automatically updated.
- API documentation.
- Public Domain via CC0-1.0 (same as source data).
- MSRV: 1.37.0 (increases are breaking changes)
- Doesn't require std.
- No dependencies.
- Works offline.
Quick start
[]
= "1.0.0"
dbg!;
API
Each gitignore is available as a variant of one of three enums:
The enums implement Display
/ .to_string()
, which will return the contents of the gitignore
(only when the std
feature is enabled):
println!;
Emacs.to_string;
The enums also implement a GitIgnore
trait:
Finally, there is a constant with the git reference of the commit the crate was built from:
dbg!;
Features
By default all gitignores are included, but you can customise this as granularily as you wish. To get started with selecting your custom set, first disable the default features:
[]
= false
= []
Collections
Feature name | Path in gitignore repo | Path in crate |
---|---|---|
root |
/*.gitignore |
Root:: |
global |
/Global/**/*.gitignore |
Global:: |
community |
/community/**/*.gitignore |
Community:: |
Individual gitignores
Each gitignore can be enabled with the <collection>-<name>
feature. Gitignores in subfolders have
the folder name prepended to the name, like <collection>-<folder>-<name>
. All are lowercased.
Other
no-contents
: omit the embedded file contents, leaving only the metadata.std
: implement theDisplay
trait on the enums.
Examples
All globals and only Rust root
[]
= false
= ["global", "root-rust"]
Some specific gitignores
[]
= false
= ["community-racket", "global-emacs", "root-commonlisp"]
Versioning
This crate respects semver!
It will bump the major version (breaking release) when:
- Gitignores disappear from a collection
- Gitignores move from a collection to another
- Gitignores are renamed
- The minimum required Rust version increases
It will bump the minor version when:
- New gitignores are added to a collection
It will bump the patch version when:
- Gitignore contents change
This repo checks for updates to the gitignore repo once a day, and automatically releases if changes are found.
License
The published crate (gitignores
) is generated from the data, which is CC0-1.0, and so it
itself is CC0-1.0 (Public Domain).
The generator code is Apache 2.0 / MIT.