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