-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathJustfile
More file actions
106 lines (84 loc) · 1.97 KB
/
Copy pathJustfile
File metadata and controls
106 lines (84 loc) · 1.97 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Setup
setup:
@echo "creating .venv"
@uv sync --locked
# Build
build-py:
uv run maturin develop \
-m encoderfile-py/Cargo.toml
# Docs
docs: docs-check docs-build
docs-build:
@uv run python scripts/prepare_gitbook_site.py
docs-check:
@uv run python scripts/check_docs.py
# Check, Test, & Coverage
check:
@cargo hack check --each-feature
coverage:
@cargo llvm-cov \
--workspace \
--all-features \
--lcov \
--output-path lcov.info
pre-commit:
@uv run --dev pre-commit run --all-files
# Lint & Format
[parallel]
format: format-rs format-py
format-rs:
@cargo fmt
format-py:
@uv run --dev -m ruff format
[parallel]
lint: lint-rs lint-py
lint-rs:
@cargo clippy \
--all-features \
--all-targets \
-- \
-D warnings
lint-py:
# ruff check
@uv run ruff check
test-py:
# test encoderfile-py bindings
@uv run \
--dev \
--directory encoderfile-py \
-m pytest
stubtest:
@uv run \
--dev \
stubtest \
--allowlist=allowlist.txt \
encoderfile._core
# Assets
generate-test-models:
@uv run \
--group models \
scripts/generate_dummy_models.py
generate-docs:
# JSON schema for encoderfile config
@cargo run \
--bin generate-encoderfile-config-schema \
--all-features
licenses:
@echo "Generating licenses..."
@cargo about generate about.hbs > THIRDPARTY.md
# Utilities
target_max_mb := "2000"
clean:
#!/usr/bin/env bash
if [ -d target ]; then
target_size_mb=$(du -sm target | cut -f1)
echo "target/ size: ${target_size_mb} MB"
if [ "${target_size_mb}" -gt "{{ target_max_mb }}" ]; then
echo "target/ exceeds {{ target_max_mb }} MB — running cargo clean..."
cargo clean
else
echo "target/ size within limits — skipping clean."
fi
else
echo "target/ does not exist — skipping clean."
fi