this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

build: switch from Taskfile (go-task) to justfile

+206 -79
-77
Taskfile.yml
··· 1 - # https://taskfile.dev 2 - 3 - # These are the helper commands used for managing/testing the repo. 4 - 5 - # 3.17 is required to use aliases in the Taskfile. 6 - version: "3.17" 7 - 8 - vars: 9 - BIN: "{{.ROOT_DIR}}/bin" 10 - 11 - tasks: 12 - default: 13 - cmd: task --list 14 - silent: true 15 - ci:full: 16 - desc: Run CI locally in containers 17 - cmd: act 18 - ci: 19 - desc: Run CI locally 20 - aliases: [ci:local] 21 - deps: [audit, fmt, test, clippy, build, build:release] 22 - clippy: 23 - desc: Run clippy 24 - cmd: cargo clippy --all-targets --all-features -- -D warnings 25 - clippy:fix: 26 - desc: Run clippy and fix errors 27 - cmd: cargo clippy --fix --allow-dirty --allow-staged --all-targets --all-features 28 - fmt: 29 - desc: Run all formatters 30 - cmds: 31 - - cargo fmt 32 - - alejandra . 33 - - prettier --write . 34 - audit: 35 - desc: Run cargo security audit 36 - sources: 37 - - Cargo.lock 38 - - flake.lock 39 - cmd: cargo audit 40 - build: 41 - desc: Build the project 42 - aliases: [b] 43 - cmd: cargo build 44 - build:release: 45 - desc: Build the project in release mode 46 - aliases: [b:release] 47 - cmd: cargo build --release 48 - commit: 49 - desc: Commit changes using custom script 50 - cmd: "{{.BIN}}/commit.sh" 51 - test: 52 - desc: Run all tests 53 - aliases: [t] 54 - cmd: cargo nextest run --no-default-features 55 - test:full: 56 - desc: Run comparisons against official tools 57 - cmd: "{{.BIN}}/test.sh {{.CLI_ARGS}}" 58 - coverage: 59 - desc: Run coverage 60 - aliases: [cov] 61 - # Many tools don't like the file references from `nix build .#coverage`, so we need to run this outside nix 62 - cmd: cargo tarpaulin --skip-clean --include-tests --output-dir coverage --out lcov --no-default-features 63 - nix:coverage: 64 - desc: Create coverage using nix 65 - cmd: nix build .#coverage --out-link coverage 66 - nix:ci: 67 - desc: Run CI locally under nix 68 - deps: [nix:check, nix:fmt, nix:build] 69 - nix:check: 70 - desc: Run Nix CI checks 71 - cmd: nix flake check 72 - nix:build: 73 - desc: Build with Nix 74 - cmd: nix build 75 - nix:fmt: 76 - desc: Run all formatters using treefmt 77 - cmd: nix fmt
+2 -2
flake.nix
··· 211 211 name = "cmprss"; 212 212 shellHook = '' 213 213 echo --------------------- 214 - task --list 214 + just --list 215 215 echo --------------------- 216 216 ''; 217 217 ··· 228 228 actionlint 229 229 deadnix 230 230 git-cliff 231 - go-task 232 231 gum # Pretty printing in scripts 232 + just 233 233 nodePackages.prettier 234 234 shellcheck 235 235 statix
+204
justfile
··· 1 + # cmprss Development Commands 2 + # Run `just` to see available recipes 3 + 4 + alias b := build 5 + alias t := test 6 + 7 + [private] 8 + default: 9 + @just --list 10 + 11 + # ============================================================================= 12 + # Development Workflows 13 + # ============================================================================= 14 + 15 + # Quick development feedback (build + test + lint) 16 + dev: 17 + just build 18 + just test 19 + just lint clippy 20 + 21 + # Run automatic fixes (clippy fix + nix fixes + format) 22 + fix: 23 + cargo clippy --fix --allow-dirty --allow-staged --all-targets --all-features 24 + statix fix . 25 + deadnix --edit . 26 + just fmt 27 + 28 + # ============================================================================= 29 + # Building 30 + # ============================================================================= 31 + 32 + # Build the project (debug or release) 33 + build mode='debug': 34 + cargo build --all-targets --all-features {{ if mode == "release" { "--release" } else { "" } }} --quiet 35 + 36 + # ============================================================================= 37 + # Testing 38 + # ============================================================================= 39 + 40 + # Run tests 41 + test *args: 42 + #!/usr/bin/env bash 43 + set -e 44 + args="{{ args }}" 45 + 46 + if [ -z "$args" ]; then 47 + cargo nextest run --no-default-features 48 + exit 0 49 + fi 50 + 51 + case "$args" in 52 + full) 53 + ./bin/test.sh 54 + ;; 55 + *) 56 + cargo nextest run --no-default-features "$args" 57 + ;; 58 + esac 59 + 60 + # ============================================================================= 61 + # Linting (Static Analysis) 62 + # ============================================================================= 63 + 64 + # Run linter(s): clippy, deny, typos, statix, deadnix, shellcheck, actionlint, all 65 + lint +tools='clippy deny typos statix deadnix shellcheck actionlint': 66 + #!/usr/bin/env bash 67 + set -e 68 + for tool in {{ tools }}; do 69 + case "$tool" in 70 + clippy) 71 + echo "=== Running clippy ===" 72 + cargo clippy --all-targets --all-features -- -D warnings 73 + ;; 74 + deny) 75 + echo "=== Running cargo-deny ===" 76 + cargo deny check 77 + ;; 78 + typos) 79 + echo "=== Running typos ===" 80 + typos --config .config/typos.toml 81 + ;; 82 + statix) 83 + echo "=== Running statix ===" 84 + statix check . 85 + ;; 86 + deadnix) 87 + echo "=== Running deadnix ===" 88 + deadnix --fail . 89 + ;; 90 + shellcheck) 91 + echo "=== Running shellcheck ===" 92 + find . -name "*.sh" -type f -exec shellcheck {} + 93 + ;; 94 + actionlint) 95 + echo "=== Running actionlint ===" 96 + find .github/workflows -name "*.yml" -exec actionlint {} + 97 + ;; 98 + all) 99 + just lint clippy deny typos statix deadnix shellcheck actionlint 100 + ;; 101 + *) 102 + echo "Unknown linter: $tool" 103 + echo "Options: clippy, deny, typos, statix, deadnix, shellcheck, actionlint, all" 104 + exit 1 105 + ;; 106 + esac 107 + done 108 + 109 + # ============================================================================= 110 + # Formatting 111 + # ============================================================================= 112 + 113 + # Run formatters: (default), check 114 + fmt mode='': 115 + #!/usr/bin/env bash 116 + set -e 117 + case "{{ mode }}" in 118 + check) 119 + cargo fmt -- --check 120 + alejandra . --check --quiet 121 + prettier --check . --log-level warn 122 + typos --config .config/typos.toml 123 + ;; 124 + *) 125 + cargo fmt 126 + alejandra . --quiet 127 + prettier --write . --log-level warn 128 + typos --write-changes --config .config/typos.toml 129 + ;; 130 + esac 131 + 132 + # ============================================================================= 133 + # Coverage 134 + # ============================================================================= 135 + 136 + # Generate coverage report 137 + coverage: 138 + cargo tarpaulin --skip-clean --include-tests --output-dir coverage --out lcov --no-default-features 139 + 140 + # Generate coverage using nix 141 + nix-coverage: 142 + nix build .#coverage --out-link coverage 143 + 144 + # ============================================================================= 145 + # CI 146 + # ============================================================================= 147 + 148 + # Run CI locally: local (default), full (containers), nix 149 + ci mode='local': 150 + #!/usr/bin/env bash 151 + set -e 152 + case "{{ mode }}" in 153 + local) 154 + just fix 155 + just lint 156 + just build 157 + just test 158 + just build release 159 + ;; 160 + full) 161 + act 162 + ;; 163 + nix) 164 + just nix check 165 + ;; 166 + *) 167 + echo "Unknown mode: {{ mode }}" 168 + echo "Options: local, full, nix" 169 + exit 1 170 + ;; 171 + esac 172 + 173 + # ============================================================================= 174 + # Nix 175 + # ============================================================================= 176 + 177 + # Nix commands: build, check, fmt 178 + nix action='check': 179 + #!/usr/bin/env bash 180 + set -e 181 + case "{{ action }}" in 182 + build) 183 + nix build 184 + ;; 185 + check) 186 + nix flake check 187 + ;; 188 + fmt) 189 + nix fmt 190 + ;; 191 + *) 192 + echo "Unknown action: {{ action }}" 193 + echo "Options: build, check, fmt" 194 + exit 1 195 + ;; 196 + esac 197 + 198 + # ============================================================================= 199 + # Commit 200 + # ============================================================================= 201 + 202 + # Interactive conventional commit 203 + commit: 204 + ./bin/commit.sh