just: Add groupings and parallel where possible
This commit is contained in:
parent
3082f9976d
commit
576bc6d6af
35
justfile
35
justfile
|
|
@ -2,40 +2,69 @@ default:
|
|||
@just --list
|
||||
|
||||
# Run pre-commit checks
|
||||
[group('hooks')]
|
||||
pre-commit: format-rust check-rust check-docs check-typos check-spelling check-scripts check-keywords format-nix
|
||||
@echo "✅ pre-commit passed"
|
||||
|
||||
# Format Rust code
|
||||
[group('pre-commit')]
|
||||
[group('pre-push')]
|
||||
[group('format')]
|
||||
[parallel]
|
||||
format-rust: (verify-tool "cargo")
|
||||
@echo "Cargo fmt..."
|
||||
@cargo fmt --all
|
||||
|
||||
# Run cargo check
|
||||
[group('pre-commit')]
|
||||
[group('pre-push')]
|
||||
[group('check')]
|
||||
[parallel]
|
||||
check-rust:
|
||||
@echo "Cargo check..."
|
||||
@cargo check --workspace --all-targets --all-features
|
||||
|
||||
# Check documentation for warnings
|
||||
[group('pre-commit')]
|
||||
[group('pre-push')]
|
||||
[group('check')]
|
||||
[parallel]
|
||||
check-docs:
|
||||
@echo "Checking docs for warnings..."
|
||||
@RUSTDOCFLAGS="--deny warnings" cargo doc --workspace --all-features --no-deps
|
||||
|
||||
# Check for typos
|
||||
[group('pre-commit')]
|
||||
[group('pre-push')]
|
||||
[group('check')]
|
||||
[parallel]
|
||||
check-typos: (verify-tool "typos" "typos-cli")
|
||||
@echo "Checking for spelling typos..."
|
||||
@typos
|
||||
|
||||
# Run codespell
|
||||
[group('pre-commit')]
|
||||
[group('pre-push')]
|
||||
[group('check')]
|
||||
[parallel]
|
||||
check-spelling: (verify-tool "codespell")
|
||||
@echo "Checking for code typos..."
|
||||
@git ls-files -z | xargs -0 codespell -w
|
||||
|
||||
# Run shellcheck on all shell scripts
|
||||
[group('pre-commit')]
|
||||
[group('pre-push')]
|
||||
[group('check')]
|
||||
[parallel]
|
||||
check-scripts: (verify-tool "shellcheck")
|
||||
@echo "Checking shell scripts..."
|
||||
@shellcheck scripts/*.sh
|
||||
|
||||
# Replicate the custom grep checks from flake.nix
|
||||
[group('pre-commit')]
|
||||
[group('pre-push')]
|
||||
[group('check')]
|
||||
[parallel]
|
||||
check-keywords: (verify-tool "rg" "ripgrep")
|
||||
#! /usr/bin/env bash
|
||||
set -e
|
||||
|
|
@ -56,6 +85,10 @@ check-keywords: (verify-tool "rg" "ripgrep")
|
|||
fi
|
||||
|
||||
# Format Nix files
|
||||
[group('pre-commit')]
|
||||
[group('pre-push')]
|
||||
[group('format')]
|
||||
[parallel]
|
||||
format-nix:
|
||||
#!/usr/bin/env bash
|
||||
if command -v alejandra >/dev/null 2>&1; then
|
||||
|
|
@ -65,10 +98,12 @@ format-nix:
|
|||
fi
|
||||
|
||||
# Run pre-push checks
|
||||
[group('hooks')]
|
||||
pre-push: format-rust check-rust check-keywords check-docs check-spelling check-scripts check-typos format-nix lint-rust
|
||||
@echo "✅ pre-push passed"
|
||||
|
||||
# Run Clippy lints
|
||||
[group('pre-push')]
|
||||
lint-rust: (verify-tool "cargo")
|
||||
@echo "Cargo clippy..."
|
||||
@cargo clippy --workspace --all-targets --all-features -- --deny warnings
|
||||
|
|
|
|||
Loading…
Reference in New Issue