justfile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import "./misc/justfile.custom.just"
  2. alias b := build
  3. alias c := check
  4. alias t := test
  5. default:
  6. @just --list
  7. final-check: typos format clippy test
  8. # run `cargo build` on everything
  9. build *ARGS="--workspace --all-targets":
  10. #!/usr/bin/env bash
  11. set -euo pipefail
  12. if [ ! -f Cargo.toml ]; then
  13. cd {{invocation_directory()}}
  14. fi
  15. cargo build {{ARGS}}
  16. # run `cargo check` on everything
  17. check *ARGS="--workspace --all-targets":
  18. #!/usr/bin/env bash
  19. set -euo pipefail
  20. if [ ! -f Cargo.toml ]; then
  21. cd {{invocation_directory()}}
  22. fi
  23. cargo check {{ARGS}}
  24. # run code formatters
  25. format:
  26. #!/usr/bin/env bash
  27. set -euo pipefail
  28. if [ ! -f Cargo.toml ]; then
  29. cd {{invocation_directory()}}
  30. fi
  31. cargo fmt --all
  32. nixpkgs-fmt $(echo **.nix)
  33. # run tests
  34. test: build
  35. #!/usr/bin/env bash
  36. set -euo pipefail
  37. if [ ! -f Cargo.toml ]; then
  38. cd {{invocation_directory()}}
  39. fi
  40. cargo test
  41. # run `cargo clippy` on everything
  42. clippy *ARGS="--locked --offline --workspace --all-targets":
  43. cargo clippy {{ARGS}}
  44. # run `cargo clippy --fix` on everything
  45. clippy-fix *ARGS="--locked --offline --workspace --all-targets":
  46. cargo clippy {{ARGS}} --fix
  47. typos:
  48. typos
  49. # fix all typos
  50. [no-exit-message]
  51. typos-fix:
  52. just typos -w