
This PR adds a new `xtask` command for checking that packages conform to certain standards. Still a work-in-progress, but right now it checks: - If `[lints] workspace = true` is set - If packages are using non-workspace dependencies Release Notes: - N/A
33 lines
850 B
Rust
33 lines
850 B
Rust
mod tasks;
|
|
mod workspace;
|
|
|
|
use anyhow::Result;
|
|
use clap::{Parser, Subcommand};
|
|
|
|
#[derive(Parser)]
|
|
#[command(name = "cargo xtask")]
|
|
struct Args {
|
|
#[command(subcommand)]
|
|
command: CliCommand,
|
|
}
|
|
|
|
#[derive(Subcommand)]
|
|
enum CliCommand {
|
|
/// Runs `cargo clippy`.
|
|
Clippy(tasks::clippy::ClippyArgs),
|
|
Licenses(tasks::licenses::LicensesArgs),
|
|
/// Checks that packages conform to a set of standards.
|
|
PackageConformity(tasks::package_conformity::PackageConformityArgs),
|
|
}
|
|
|
|
fn main() -> Result<()> {
|
|
let args = Args::parse();
|
|
|
|
match args.command {
|
|
CliCommand::Clippy(args) => tasks::clippy::run_clippy(args),
|
|
CliCommand::Licenses(args) => tasks::licenses::run_licenses(args),
|
|
CliCommand::PackageConformity(args) => {
|
|
tasks::package_conformity::run_package_conformity(args)
|
|
}
|
|
}
|
|
}
|