Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci-pydgraph-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
python-version: "3.13"
- name: Setup project dependencies
run: INSTALL_MISSING_TOOLS=true make setup
- name: Sync python virtualenv
run: make sync
- name: Check generated protobufs are current
run: |
make protogen
git diff --exit-code -- .
- name: Run code quality checks
run: SKIP=no-commit-to-branch,trunk-check,trunk-fmt make check
run: trunk check --all --ci
- name: Run ty type checker
run: uv run ty check pydgraph tests
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ examples/notebook/RAG/.env
# Git worktrees
.worktrees/

# Local design/plan documents
docs/plans/

# Benchmark outputs
benchmark-results.json
benchmark-histogram.svg
Expand Down
87 changes: 0 additions & 87 deletions .pre-commit-config.yaml

This file was deleted.

37 changes: 36 additions & 1 deletion .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,43 @@ lint:
- pydgraph/proto/api_pb2_grpc.py
- pydgraph/proto/api_pb2_grpc.pyi
- examples/notebook/**/*.ipynb
- linters: [mypy]
paths:
- examples/**
- linters: [markdownlint]
paths:
- docs/plans/**
- linters: [bandit]
paths:
- tests/**
- examples/**
definitions:
- name: mypy
extra_packages:
- types-requests>=2.32.0
- pydantic-settings>=2.12.0
- mypy-protobuf>=4.0.0
- grpc-stubs>=1.53.0
- types-grpcio>=1.0.0
- types-protobuf>=6.32.0
- pytest>=8.3.3
- grpcio-tools>=1.66.2
- packaging>=24.0
commands:
- name: lint
output: mypy
run: mypy --config-file=pyproject.toml --show-column-numbers ${target}
run_from: ${root_or_parent_with_any_config}
success_codes: [0]
stdin: false
- name: pre-commit-hooks
commands:
- name: check-added-large-files
enabled: true
- name: check-docstring-first
enabled: true
- name: check-merge-conflict
enabled: true
enabled:
- trivy@0.68.2
- trivy@0.58.2
Expand All @@ -38,6 +71,8 @@ lint:
- checkov@3.2.495
- git-diff-check
- markdownlint@0.47.0
- mypy@1.18.2
- pre-commit-hooks@6.0.0
- prettier@3.7.4
- ruff@0.14.10
- shellcheck@0.11.0
Expand All @@ -48,6 +83,6 @@ lint:
actions:
enabled:
- trunk-announce
- trunk-check-pre-push
- trunk-fmt-pre-commit
- trunk-check-pre-push
- trunk-upgrade-available
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,14 @@ help: ## Show this help message
@echo ""

setup: deps ## Setup project (install tools and sync dependencies)
@if [ ! -f .git/hooks/pre-commit ] || ! grep -q "pre-commit" .git/hooks/pre-commit 2>/dev/null; then \
echo "Installing pre-commit hooks..."; \
uv run pre-commit install; \
fi
@$(MAKE) sync

sync: ## Sets up and syncs project virtual environment.
$(RUN) uv sync --group dev --extra dev

check: ## Run pre-commit hooks on all files
$(RUN) pre-commit run --all-files
check: ## Run code quality checks on all files
trunk check --all --no-fix
$(RUN) uv run ty check pydgraph tests

protogen: ## Regenerate protobuf files (requires Python 3.13+)
$(RUN) uv run python scripts/protogen.py
Expand Down
Loading
Loading