Skip to content

Commit

Permalink
chore: improve cargo make with strict by default and better help (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximmaxim345 authored Feb 2, 2025
2 parents 0415f74 + 41324d3 commit 385703f
Showing 1 changed file with 51 additions and 49 deletions.
100 changes: 51 additions & 49 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true

[tasks.verify-strict]
description = "Run all verification tasks with strict warning settings"
[tasks.verify]
description = "Run most verification tasks"
workspace = false
dependencies = [
"run-all-tests",
"lint-strict",
"docs-strict",
"run-tests",
"lint",
"docs",
"spell-check",
"verify-doc-tests",
"verify-formatting",
"deny",
]

[tasks.verify]
description = "Run most verification tasks"
[tasks.verify-all]
description = "Run all verification tasks"
workspace = false
dependencies = [
"run-tests",
"run-all-tests",
"lint",
"docs",
"spell-check",
Expand Down Expand Up @@ -48,22 +48,6 @@ args = [
]
install_crate = "cargo-nextest"

[tasks.lint]
workspace = false
command = "cargo"
args = ["clippy", "--workspace", "--tests", "--benches", "--all-features"]

[tasks.docs]
workspace = false
command = "cargo"
args = [
"doc",
"--workspace",
"--no-deps",
"--all-features",
"--document-private-items",
]

[tasks.deny]
workspace = false
command = "cargo"
Expand All @@ -85,7 +69,7 @@ workspace = false
command = "cargo"
args = ["fmt", "--check", "--all"]

[tasks.lint-strict]
[tasks.lint]
description = "Run Clippy with warnings treated as errors"
workspace = false
command = "cargo"
Expand All @@ -100,7 +84,7 @@ args = [
"warnings",
]

[tasks.docs-strict]
[tasks.docs]
description = "Generate documentation with warnings treated as errors"
workspace = false
command = "cargo"
Expand Down Expand Up @@ -261,27 +245,45 @@ description = "Display help information about available tasks"
workspace = false
script_runner = "@rust"
script = '''
println!("Available tasks:");
println!("\nVerification Tasks:");
println!(" verify - Run all standard verification tasks");
println!(" verify-strict - Run all verification tasks with strict warning settings");
println!(" test-wasm - Run all tests on a wasm build");
println!("\nWASM Build Tasks:");
println!(" build-wasm-dev - Build WASM target (development version)");
println!(" build-wasm-debug - Build WASM target (with debug information)");
println!(" build-wasm-release - Build WASM target (release version)");
println!(" (this will automatically setup a wasm build environment)");
println!("\nServer Tasks:");
println!(" dev - Build development version and serve it");
println!(" debug - Build debug version and serve it");
println!(" release - Build release version and serve it");
println!(" serve - Serve the last build");
println!("\nUsage:");
println!(" cargo make <task-name>");
println!("\nExample:");
println!(" cargo make verify");
println!(" cargo make dev");
//! ```cargo
//! [dependencies]
//! colored = "2.0"
//! ```
use colored::*;
fn main() {
println!("{}", "CADara Build System".bold().blue());
println!("\n{}", "Usage:".bold());
println!(" cargo make <task-name>\n");
println!(" cargo make verify # Run verification suite");
println!(" cargo make dev # Start WASM development server");
println!(" cargo make test-wasm # Run WASM test suite");
println!("\n{}", "Note:".bold());
println!(" All commands must be executed from the repository root directory\n");
println!("{}", "Primary Commands:".bold().green());
println!(" verify - Run standard verification suite");
println!(" verify-all - Run extended verification suite (including ignored tests)");
println!(" dev - Start WASM server");
println!(" debug - Start WASM server with debug symbols");
println!(" release - Start WASM production server\n");
println!("{}", "Verification Tasks:".bold().yellow());
println!(" run-tests - Run workspace tests (via nextest)");
println!(" run-all-tests - Run all tests including ignored ones");
println!(" lint - Run Clippy");
println!(" docs - Generate documentation");
println!(" spell-check - Check for typos in codebase");
println!(" verify-doc-tests - Verify documentation examples");
println!(" verify-formatting - Check code formatting");
println!(" deny - Check dependencies compliance\n");
println!("{}", "WASM Operations:".bold().magenta());
println!(" build-wasm-dev - Build WASM target (development)");
println!(" build-wasm-debug - Build WASM target (with debug info)");
println!(" build-wasm-release - Build WASM target (production)");
println!(" test-wasm - Run WASM-specific tests");
println!(" serve - Start local web server (port 8080)\n");
}
'''

0 comments on commit 385703f

Please sign in to comment.