Crate of GitHub’s collection of gitignores, embedded, automatically updated

Related tags

Utilities gitignores
Overview

Crate release version Crate license: CC0-1.0 MSRV: 1.37.0 (breaking) CI status

Gitignores

GitHub’s collection of gitignores, embedded, automatically updated.

Quick start

[dependencies]
gitignores = "1.0.0"
dbg!(gitignores::Root::Rust);

API

Each gitignore is available as a variant of one of three enums:

(
	gitignores::Root::Rust,
	gitignores::Global::Emacs,
	gitignores::Community::Racket,
)

The enums implement Display / .to_string(), which will return the contents of the gitignore (only when the std feature is enabled):

println!("{}", gitignores::Root::Rust);
gitignores::Global::Emacs.to_string();

The enums also implement a GitIgnore trait:

trait GitIgnore {
	/// The contents of the gitignore
	///
	/// Returns an empty string if the `no-contents` feature is enabled.
	fn contents(self) -> &'static str;

	/// The file name of the gitignore
	fn file_name(self) -> &'static str;

	/// The full path of the gitignore relative to repo root
	fn file_path(self) -> &'static str;

	/// The list of all included gitignores
	fn list() -> Vec<&'static str>;
}

Finally, there is a constant with the git reference of the commit the crate was built from:

dbg!(gitignores::GIT_COMMIT_REF);

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:

[dependencies.gitignores]
default-features = false
features = []

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 - feature. Gitignores in subfolders have the folder name prepended to the name, like - - . All are lowercased.

Other

  • no-contents: omit the embedded file contents, leaving only the metadata.
  • std: implement the Display trait on the enums.

Examples

All globals and only Rust root

[dependencies.gitignores]
default-features = false
features = ["global", "root-rust"]

Some specific gitignores

[dependencies.gitignores]
default-features = false
features = ["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.

You might also like...
diff successive buffers with embedded ansi codes in rust, outputting a minimal change

ansi-diff diff successive buffers with embedded ansi codes in rust, outputting a minimal change You can use this crate to build command-line interface

TI LDC1312/LDC1314/LDC1612/LDC1614 inductance-to-digital converter driver for Rust embedded-hal

ldc1x1x Rust embedded-hal 1.x driver for Texas Instruments (TI) I²C inductance-to-digital converters (LDC): LDC1312/LDC1314, LDC1612/LDC1614. Includes

Ector is an open source async, no-alloc actor framework for embedded devices

Ector is an open source async, no-alloc actor framework for embedded devices. Ector is an open source async, no-alloc actor framework for embedded dev

An embedded-hal driver for the TT21100 multi-touch touchscreen controller

tt21100 An embedded-hal driver for the TT21100 multi-touch touchscreen controller. If there is a feature which has not yet been implemented and which

Embedded-hal simulator.

hal-sim - embedded-hal Simulator (WIP - UNFINISHED) This crate simulates a small portion of the embedded-hal traits. Namely: GPIO ADC Additionally, it

Port of the fantastic Iconoir Icon Pack to Rust embedded devices, with a focus on speed, usability, and completeness.
Port of the fantastic Iconoir Icon Pack to Rust embedded devices, with a focus on speed, usability, and completeness.

embedded-iconoir - Icons for every device, ever. What is embedded-iconor? embedded-iconoir is a library that allows you to use Iconoir on embedded dev

Drop-in embedded database
Drop-in embedded database

Struct DB 🔧 🔩 Provides a drop-in, fast, and embedded database solution, focusing on maintaining coherence between Rust types and stored data with mi

A reactive runtime for embedded systems.

Actuate Examples A reactive diagram for robotics and control systems. Actuate leverages Rust's type system to create an efficient diagram that connect

A small utility for tracking the change in opening and closing of issues in a GitHub repo

A small utility for tracking the change in opening and closing of issues in a GitHub repo. This tool can be used to build visualizations for issue triage over time with the hope of motivating closing more issues than are opened.

Owner
null
⚙️ Crate to discover embedded programming with uno r3 project

⚙️ Crate to discover embedded programming with uno r3 project

null 0 Feb 3, 2022
A git hook to manage derivative files automatically.

git-derivative A git hook to manage derivative files automatically. For example if you checked out to a branch with different yarn.lock, git-derivativ

Sung Jeon 3 Oct 30, 2022
Automatically build a Rust module tree from the project directory structure

Hypermod An even lazier version of automod and supermod. Searches the src/ directory recursively for .rs files, then builds a module tree using the di

null 4 Aug 3, 2022
Automatically cross-compiles the sysroot crates core, compiler_builtins, and alloc.

cargo-xbuild Cargo-xbuild is a wrapper for cargo build, which cross compiles the sysroot crates core, compiler_builtins, and alloc for custom targets.

Rust OSDev 241 Dec 30, 2022
Automatically transform your Next.js Pages to use SuperJSON with SWC

?? NEXT SUPERJSON PLUGIN export default function Page({ date }) { return ( <div> Today is {date.toDateString()} </div> ) } // You c

⚡️Blitz 92 Jan 4, 2023
A CLI tool that automatically writes commit messages for you.

Automagically-generated commit messages A CLI tool that generates commit messages from your staged changes, built in Rust and using OpenAI's Codex. In

Miguel Piedrafita 839 Jan 6, 2023
A swc plugin that automatically converts React component libraries into "React Client Component"

A swc plugin that automatically converts React component libraries into "React Client Component". For example, you can automatically convert components from @mui into "React Client Component" without having to wrap a component that uses "use client".

xiaotian 3 Jul 12, 2023
C API to SpringQL (for embedded mode)

SpringQL C Client This repository is a C client for SpringQL and provides it provides: springql.h: C header file. libspringql_client.{so,dylib}: Share

SpringQL 4 Jun 8, 2022
An asynchronous Hardware Abstraction Layer (HAL) for embedded systems

embedded-hal-async An asynchronous Hardware Abstraction Layer (HAL) for embedded systems. This crate contains asynchronous versions of the embedded-ha

Diego Barrios Romero 3 Jan 22, 2022
A compatibility layer to smooth the transition between different versions of embedded-hal

Embedded HAL Compatibility Layer A compatibility layer to smooth the transition between different versions of embedded-hal (specifically 0.2.x and 1.0

Ryan 7 Sep 11, 2022