Expand description
Rust workspace analysis and automation tool for managing multi-package projects.
Clippier provides utilities for analyzing Rust workspaces and automating development tasks with a focus on CI/CD pipeline generation, dependency analysis, and feature management.
§Core Features
- CI/CD Pipeline Generation - Generate feature matrices for comprehensive testing
- Dependency Analysis - Analyze workspace dependencies and relationships
- Feature Management - Generate and validate feature combinations
- Feature Propagation Validation - Ensure features propagate correctly across workspace dependencies
- Change Impact Analysis - Determine which packages are affected by file changes
- Docker Integration - Generate optimized Dockerfiles for workspace packages
- External Dependency Tracking - Detect changes in external dependencies via git diff
§Basic Usage
The primary entry point is the command-line tool, but the library also exports core functionality for programmatic use:
use clippier::{FeatureValidator, ValidatorConfig, OutputType};
type BoxError = Box<dyn std::error::Error + Send + Sync>;
// Validate feature propagation across workspace
let config = ValidatorConfig {
features: Some(vec!["fail-on-warnings".to_string()]),
output_format: OutputType::Json,
..Default::default()
};
let validator = FeatureValidator::new(None, config)?;
let result = validator.validate()?;
println!("Validated {} packages", result.total_packages);§Optional Features
git-diff(default) - Enhanced change analysis using git diff to detect external dependency changestest-utils- Utilities for testing (automatically enabled when running tests)fail-on-warnings- Fail build on compiler warnings
Re-exports§
pub use feature_validator::FeatureValidator;pub use feature_validator::ValidationResult;pub use feature_validator::ValidatorConfig;pub use feature_validator::print_github_output;pub use feature_validator::print_human_output;pub use publish::PublishConfig;pub use publish::handle_publish_command;
Modules§
- feature_
validator - Feature propagation validation for workspace dependencies.
- git_
diff - Git diff analysis for detecting external dependency changes.
- package_
filter - Package filtering based on Cargo.toml properties.
- publish
- Cargo workspace publishing support. Cargo workspace publishing support.
- tools
- Tool detection and execution infrastructure for linting and formatting.
- transforms
- Matrix transformation system with Lua scripting support.
- versioning
- Cargo workspace version bumping support. Cargo workspace version bumping support.
- workspace
- Generic workspace abstraction for monorepo support.
Structs§
- Affected
Package Info - Information about a package affected by changes
- Affected
Packages Result - Result structure for affected packages command
- Cargo
Lock - Representation of a Cargo.lock file
- Cargo
Lock Package - A package entry in a Cargo.lock file
- Clippier
Conf - Root configuration structure for clippier.toml files
- Clippier
Configuration - Configuration for a single platform/OS in clippier.toml
- Node
Config - Node.js-specific configuration options.
- Package
Info - Information about a workspace package
- Parallelization
Config - Configuration for parallelization settings
- Propagated
Config - Configuration that propagates from workspace dependencies
- Rust
Config - Rust-specific configuration options.
- Single
Package Result - Result structure for single package analysis
- Split
Iter - Iterator that yields chunks from a slice
- Step
- A build or dependency step in CI configuration
- Workspace
Clippier Conf - Workspace-level configuration (root clippier.toml)
- Workspace
Context - Context for workspace member resolution and caching
- Workspace
Deps Result - Result structure for workspace dependencies command
- Workspace
Toolchains - Aggregated toolchain information for workspace-level CI setup
Enums§
- Clippier
Env - Environment variable configuration that can be filtered by features
- Color
Mode - Color mode for tool output forwarding
- Features
List - List of features that may be chunked for parallel processing
- Output
Type - Output format for CLI commands
- VecOr
Item - Helper type that accepts either a single item or a vector of items
Functions§
- apply_
max_ parallel_ rechunking - Handle chunking and
max_parallelre-chunking by combining packages - collect_
environment_ variables - Collects environment variables for a target package
- collect_
system_ dependencies - Collects system dependencies for a target package
- create_
map - Creates a JSON map from a configuration
- expand_
active_ package_ features - Expands requested package features to include all transitively activated package features.
- expand_
features_ from_ cargo_ toml - Expands wildcard patterns in a feature list against available features from Cargo.toml.
- expand_
pattern_ list - Expands wildcard patterns in a list to match against available items.
- fetch_
features - Fetches and filters features from a Cargo.toml file
- find_
affected_ packages - Finds packages that are affected by changed files
- find_
affected_ packages_ with_ reasoning - Finds packages that are affected by changed files with reasoning
- find_
workspace_ dependencies - Finds workspace dependencies for a target package
- generate_
dockerfile - Generates a Dockerfile for a target package
- generate_
dockerfile_ content - Generates Dockerfile content for a workspace package.
- generate_
dockerfile_ content_ from_ git - Generates Dockerfile content for a package built from a git repository.
- generate_
dockerfile_ from_ git - Generates a Dockerfile for a target package from a git URL
- generate_
dockerignore_ content - Generates the content of a .dockerignore file for a target package
- generate_
dockerignore_ content_ for_ git - Generates
.dockerignorefile content for git-based builds. - get_
binary_ name - Gets the binary name for a package, using override if provided or reading from Cargo.toml
- get_
dependency_ default_ features - Gets the default-features setting for a dependency
- get_
feature_ dependencies - Extracts feature-activated dependencies from a Cargo.toml file
- handle_
affected_ packages_ command - Handles the affected packages command
- handle_
check_ command - Handles the check command (run linters and format checkers)
- handle_
ci_ steps_ command - Handles the CI steps command
- handle_
dependencies_ command - Handles the dependencies command
- handle_
environment_ command - Handles the environment command
- handle_
features_ command - Generates a feature matrix for workspace packages.
- handle_
fmt_ command - Handles the fmt command (run formatters)
- handle_
generate_ dockerfile_ command - Handles the generate dockerfile command
- handle_
packages_ command - Errors
- handle_
validate_ feature_ propagation_ command - Handles the validate feature propagation command
- handle_
workspace_ deps_ command - Handles the workspace deps command
- handle_
workspace_ toolchains_ command - Aggregates all toolchains and dependencies from workspace packages for CI setup.
- is_
git_ url - Determines if a path string is a git URL
- is_
workspace_ dependency - Checks if a dependency uses workspace inheritance
- is_
workspace_ dependency_ with_ features - Checks if a dependency uses workspace inheritance with features
- matches_
pattern - Checks if an item matches a pattern (supports wildcards and exact matches).
- parse_
dependency_ name - Parses a dependency line to extract the package name
- process_
configs - Processes a Cargo.toml file and returns a list of packages with their features
- process_
features - Processes a list of features with optional chunking, spreading, and randomization
- process_
workspace_ configs - Processes workspace configurations and returns a list of packages with their dependencies
- should_
skip_ feature - Checks if a feature should be skipped based on patterns.
- split
- Splits a slice into approximately
nequal-sized chunks