Skip to content

docs: merge Karpathy coding guidelines into CLAUDE.md #86

docs: merge Karpathy coding guidelines into CLAUDE.md

docs: merge Karpathy coding guidelines into CLAUDE.md #86

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Validate pyproject.toml
run: |
python - <<'EOF'
import tomllib, sys
with open("pyproject.toml", "rb") as f:
data = tomllib.load(f)
project = data.get("project", {})
errors = []
# [project].dependencies must exist and be a list
deps = project.get("dependencies")
if deps is None:
errors.append("[project].dependencies is missing")
elif not isinstance(deps, list):
errors.append(f"[project].dependencies must be a list, got {type(deps).__name__}")
# [project.urls] values must all be strings
urls = project.get("urls", {})
for key, val in urls.items():
if not isinstance(val, str):
errors.append(
f"[project.urls].{key} must be a string, got {type(val).__name__} — "
f"'dependencies' may have been accidentally merged into [project.urls]"
)
if errors:
for e in errors:
print(f"ERROR: {e}", file=sys.stderr)
sys.exit(1)
print("pyproject.toml structure OK")
EOF
- name: Install
run: python -m pip install -e ".[dev]"
- name: Lint
run: python -m ruff check packages tests scripts
- name: Format check
run: python -m ruff format --check packages tests scripts
- name: Typecheck
run: python -m mypy packages/devcd-core/src
- name: Test
run: python -m pytest tests -q
codeql:
name: CodeQL Security Scan
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
steps:
- uses: actions/checkout@v4
- uses: github/codeql-action/init@v3
with:
languages: python
- uses: github/codeql-action/autobuild@v3
- uses: github/codeql-action/analyze@v3