cargo-culture-kit
Overview
Core library for the cargo-culture project that provides the basic building blocks for running straightforward checks on a Rust project repo.
The primary intended application of these checks is within a command-line tool that contains and enforces best practices across repositories according to the needs of that organization.
The secondary envisioned application of these checks is integrated into Rust tests. This case may appeal to appeal to developers that want a rapid deep-integration path, don't mind writing a bit of code, and prefer to avoid the use of support programs.
Getting Started
Dependencies
cargo-culture-kit
is a Rust project, and manages its dependencies with cargo
,
available as part of the standard Rust toolchain.
Building
For local program development, you can build cargo-culture-kit
with:
- Download the project repository
- Execute a build
Installation
You can include cargo-culture-kit
in your Rust project
by adding to your Cargo.toml file.
- Added to the
[dependencies]
or ``[dev-dependencies]` section:= "0.1"
Usage
check_culture_default
is the easiest way to get started,
as it provides a thin wrapper around the core check_culture
function in combination with the Rule
s provided by the
default_rules()
function. Rule
is the core trait of this crate. A Rule
describes an idiom or best-practice
for projects and provides a means of evaluating whether that rule of thumb
is being upheld.
use ;
use PathBuf;
let cargo_manifest = from;
let verbose = false;
let outcomes = check_culture_default
.expect;
let stats = from;
assert!;
assert_eq!;
assert_eq!;
Examples
- An example of implementing your own
Rule
:use ;
Tests
The cargo-culture-kit
tests are managed through the standard
cargo-integrated Rust test framework, with additional enhancement
through the proptest property based testing library.
Building
To build but not run the tests:
Running
To both build and run the tests:
License
© 2018, PolySync Technologies, Inc.
- Zack Pierce email
Please see the LICENSE file for more details