mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
390f93344c
* Add samples syntax checking with pyright - Add pyrightconfig.samples.json with relaxed type checking but import validation - Add samples-syntax poe task to check samples for syntax and import errors - Add samples-syntax to check and pre-commit-check tasks - Fix 78 sample errors: - Update workflow builder imports to use agent_framework_orchestrations - Change content type isinstance checks to content.type comparisons - Use Content factory methods instead of removed content type classes - Fix TypedDict access patterns for Annotation - Fix various API mismatches (normalize_messages, ChatMessage.text, role) * fixed a bunch of samples and tweaks to pre-commit * updated lock * updated lock * fixes * added lint to samples
60 lines
1.9 KiB
YAML
60 lines
1.9 KiB
YAML
files: ^python/
|
|
fail_fast: true
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v5.0.0
|
|
hooks:
|
|
- id: check-toml
|
|
name: Check TOML files
|
|
files: \.toml$
|
|
exclude: ^python/packages/lab/cookiecutter-agent-framework-lab/
|
|
- id: check-yaml
|
|
name: Check YAML files
|
|
files: \.yaml$
|
|
- id: check-json
|
|
name: Check JSON files
|
|
files: \.json$
|
|
exclude: ^.*\.vscode\/.*|^python/demos/samples/chatkit-integration/frontend/(tsconfig.*\.json|package-lock\.json)$
|
|
- id: end-of-file-fixer
|
|
name: Fix End of File
|
|
files: \.py$
|
|
exclude: ^python/packages/lab/cookiecutter-agent-framework-lab/
|
|
- id: mixed-line-ending
|
|
name: Check Mixed Line Endings
|
|
files: \.py$
|
|
exclude: ^python/packages/lab/cookiecutter-agent-framework-lab/
|
|
- id: check-ast
|
|
name: Check Valid Python Samples
|
|
types: ["python"]
|
|
exclude: ^python/packages/lab/cookiecutter-agent-framework-lab/
|
|
- repo: https://github.com/asottile/pyupgrade
|
|
rev: v3.20.0
|
|
hooks:
|
|
- id: pyupgrade
|
|
name: Upgrade Python syntax
|
|
args: [--py310-plus]
|
|
exclude: ^python/packages/lab/cookiecutter-agent-framework-lab/
|
|
- repo: local
|
|
hooks:
|
|
- id: poe-check
|
|
name: Run checks through Poe
|
|
entry: uv --directory ./python run poe pre-commit-check
|
|
language: system
|
|
files: ^python/
|
|
- repo: https://github.com/PyCQA/bandit
|
|
rev: 1.8.5
|
|
hooks:
|
|
- id: bandit
|
|
name: Bandit Security Checks
|
|
args: ["-c", "python/pyproject.toml"]
|
|
additional_dependencies: ["bandit[toml]"]
|
|
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
# uv version.
|
|
rev: 0.7.18
|
|
hooks:
|
|
# Update the uv lockfile
|
|
- id: uv-lock
|
|
name: Update uv lockfile
|
|
files: python/pyproject.toml
|
|
args: [--project, python]
|