justfile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION
  2. alias b := build
  3. alias c := check
  4. alias t := test
  5. [private]
  6. default:
  7. @just --list
  8. # run `cargo build` on everything
  9. build:
  10. cargo build --workspace --all-targets
  11. # run `cargo check` on everything
  12. check:
  13. cargo check --workspace --all-targets
  14. # run all checks recommended before opening a PR
  15. final-check: lint clippy
  16. cargo test --doc
  17. just test
  18. # run code formatters
  19. format:
  20. cargo fmt --all
  21. nixpkgs-fmt $(echo **.nix)
  22. # run lints (git pre-commit hook)
  23. lint:
  24. env NO_STASH=true $(git rev-parse --git-common-dir)/hooks/pre-commit
  25. # run tests
  26. test: build
  27. cargo test
  28. # run and restart on changes
  29. watch:
  30. env RUST_LOG=${RUST_LOG:-debug} cargo watch -x run
  31. # run `cargo clippy` on everything
  32. clippy:
  33. cargo clippy --locked --offline --workspace --all-targets -- --deny warnings --allow deprecated
  34. # run `cargo clippy --fix` on everything
  35. clippy-fix:
  36. cargo clippy --locked --offline --workspace --all-targets --fix
  37. # run `semgrep`
  38. semgrep:
  39. env SEMGREP_ENABLE_VERSION_CHECK=0 \
  40. semgrep --error --no-rewrite-rule-ids --config .config/semgrep.yaml
  41. # check typos
  42. [no-exit-message]
  43. typos *PARAMS:
  44. #!/usr/bin/env bash
  45. set -eo pipefail
  46. export FLAKEBOX_GIT_LS
  47. FLAKEBOX_GIT_LS="$(git ls-files)"
  48. export FLAKEBOX_GIT_LS_TEXT
  49. FLAKEBOX_GIT_LS_TEXT="$(echo "$FLAKEBOX_GIT_LS" | grep -v -E "^db/|\.(png|ods|jpg|jpeg|woff2|keystore|wasm|ttf|jar|ico)\$")"
  50. if ! echo "$FLAKEBOX_GIT_LS_TEXT" | typos {{PARAMS}} --file-list - --force-exclude ; then
  51. >&2 echo "Typos found: Valid new words can be added to '.typos.toml'"
  52. return 1
  53. fi
  54. # fix all typos
  55. [no-exit-message]
  56. typos-fix-all:
  57. just typos -w
  58. # THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION