M0.3: xtask ci, layers, assets, cleanroom, ui-licences, dev, fixtures

layers reads cargo metadata and rejects upward, sideways and tool-crate
dependencies and any path to Tauri below L6. assets checks ASSETS.md rows
and rejects committed fonts. cleanroom rejects JetBrains copyright notices,
exported IDE configuration and .idea/.jar/.icls files. deny.toml mirrors
the licence allow list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-13 20:32:00 +02:00
parent ec1c72d9ac
commit 3bd95343cc
8 changed files with 1130 additions and 2 deletions

View file

@ -3,7 +3,12 @@
//! Every subcommand prints what it checks and exits with status 1 and a
//! message when the check fails.
mod assets;
mod cleanroom;
mod layers;
mod licences;
mod lints;
mod tasks;
mod util;
use std::process::ExitCode;
@ -12,17 +17,39 @@ use std::process::ExitCode;
const USAGE: &str = "usage: cargo xtask <command>
commands:
lints-selftest prove that shipped unwrap() fails clippy and test unwrap() passes";
ci [--skip-ui] the full quality gate (run before every commit)
layers check the crate layering
assets check that every asset has a row in ASSETS.md
cleanroom check for JetBrains copyright notices and exported configuration
ui-licences check the licences of the frontend's production dependencies
lints-selftest prove that shipped unwrap() fails clippy and test unwrap() passes
dev [-- ARGS] run the desktop app in development mode, ARGS go to the app
fixtures create Symfony and Laravel reference projects in target/fixtures/";
/// Dispatches to the subcommand named by the first argument.
fn main() -> ExitCode {
let args: Vec<String> = std::env::args().skip(1).collect();
let Some(command) = args.first() else {
let Some((command, rest)) = args.split_first() else {
println!("{USAGE}");
return ExitCode::SUCCESS;
};
let result = match command.as_str() {
"ci" => tasks::ci(rest.iter().any(|a| a == "--skip-ui")),
"layers" => layers::check_workspace(),
"assets" => assets::check_repo(),
"cleanroom" => cleanroom::check_repo(),
"ui-licences" => licences::check_ui(),
"lints-selftest" => lints::selftest(),
"dev" => {
let app_args: Vec<String> = rest
.iter()
.skip_while(|a| *a != "--")
.skip(1)
.cloned()
.collect();
tasks::dev(&app_args)
}
"fixtures" => tasks::fixtures(),
"help" | "--help" | "-h" => {
println!("{USAGE}");
Ok(())