summaryrefslogtreecommitdiff
path: root/justfile
blob: 1e0efea13cd3688fb53175bc13b21d2a8b12fca9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
alias fmt := format

_default:
    @just --list

# Auto-format source code.
format:
    cargo fmt --all
    env RUST_LOG=warn taplo format
    find . -type f -iname justfile -print0 | xargs -0rn 1 just --fmt --unstable --justfile
    find . -type f -name '*.nix' -print0 | xargs -0rn 1 nixfmt

# Run all checks.
[env("CARGO_BUILD_WARNINGS", "deny")]
check:
    @# Check format
    cargo fmt --all --check
    env RUST_LOG=warn taplo format --check
    find . -type f -iname justfile -print0 | xargs -0rn 1 just --fmt --unstable --check --justfile
    @# nix fmt -- --ci # treefmt --ci is not read-only
    find . -type f -name '*.nix' -print0 | xargs -0rn 1 nixfmt --check
    @# Lint
    env RUST_LOG=warn taplo lint
    cargo clippy --workspace --all-targets --all-features -- --deny warnings
    @# Build
    cargo build --workspace --all-targets --all-features --keep-going
    cargo doc --all-features --no-deps --document-private-items --keep-going
    @# Test
    cargo test --workspace --all-targets --all-features
    @# Check dependencies for known security vulnerabilities, licenses, etc.
    cargo audit
    cargo deny --workspace --all-features check --show-stats bans licenses sources
    @# Check Nix flake
    nix flake check --print-build-logs --verbose
    cd examples/nixos/ && nix flake check --print-build-logs --verbose --override-input temp-postgres ../..
Generated by cgit. See skreutz.com for my tech blog and contact information.