forked from docling-project/docling
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (46 loc) · 2.08 KB
/
Makefile
File metadata and controls
59 lines (46 loc) · 2.08 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
.PHONY: help setup hooks-install check check-all validate validate-all fix typecheck tach dprint-check dprint-fix test
help: ## Show available targets.
@awk 'BEGIN {FS = ":.*##"; print "Available targets:"} /^[a-zA-Z0-9_.-]+:.*##/ {printf " %-14s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
setup: ## Install CI-style development environment.
uv sync --frozen --group dev --all-extras --no-group docs --no-group examples
hooks-install: ## Install git hooks via prek.
uv run prek install
check: check-all ## Run read-only local checks.
check-all: ## Run all read-only local checks.
uv run ruff format --check --config=pyproject.toml docling tests docs/examples
uv run ruff check --config=pyproject.toml docling tests docs/examples
uv run --no-sync ty check
uv run --no-sync tach check
python3 scripts/check_tach_module_coverage.py
python3 scripts/check_max_lines.py
uv run --no-sync dprint check --config .github/dprint.json --config-discovery=false
uv lock --locked
validate: ## Run hooks on the current changeset.
@files="$$( \
{ \
git diff --name-only --diff-filter=ACMR; \
git diff --cached --name-only --diff-filter=ACMR; \
git ls-files --others --exclude-standard; \
} | sort -u \
)"; \
if [ -z "$$files" ]; then \
echo "No changed files to validate."; \
else \
printf '%s\n' "$$files" | xargs uv run prek run --files; \
fi
validate-all: ## Run hooks on all files.
uv run prek run --all-files
fix: ## Run Ruff and dprint auto-format/fixers.
uv run ruff format --config=pyproject.toml docling tests docs/examples
uv run ruff check --fix --config=pyproject.toml docling tests docs/examples
uv run dprint fmt --config .github/dprint.json --config-discovery=false
typecheck: ## Run ty.
uv run --no-sync ty check
tach: ## Run Tach module-boundary checks.
uv run --no-sync tach check
dprint-check: ## Run dprint in check mode.
uv run --no-sync dprint check --config .github/dprint.json --config-discovery=false
dprint-fix: ## Run dprint formatter.
uv run --no-sync dprint fmt --config .github/dprint.json --config-discovery=false
test: ## Run the default test suite.
uv run pytest -v