Files
docling/Makefile
geoHeil 5b1df788ef ci: tighten pre-commit guardrails (#3346)
* ci: tighten pre-commit guardrails

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* ci: validate pre-commit guardrail changes

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* ci: switch hook validation to prek

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* ci: exempt active slim plan from max-lines

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* ci: move max-lines config under github

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* ci: fail on uncovered tach modules

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* ci: ignore generated docs in max-lines check

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* ci: clarify local validation tasks

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* docs: refine agent instructions

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* ci: replace mypy with ty

(cherry picked from commit 382afbde8f00abfaeba95ea9c8e9cc603f27a2d9)
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* ci: replace justfile with makefile

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

---------

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
2026-05-08 15:07:11 +02:00

60 lines
2.1 KiB
Makefile

.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