OpenHands/enterprise/dev_config/python/.pre-commit-config.yaml
Ray Myers 4513bcc622
chore - MyPy check Enterprise with OpenHands (#10858)
Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
2025-09-11 11:05:50 -04:00

58 lines
1.6 KiB
YAML

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: docs/modules/python
files: ^enterprise/
- id: end-of-file-fixer
exclude: docs/modules/python
files: ^enterprise/
- id: check-yaml
files: ^enterprise/
- id: debug-statements
files: ^enterprise/
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
hooks:
- id: validate-pyproject
types: [toml]
files: ^enterprise/pyproject\.toml$
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.1
hooks:
# Run the linter.
- id: ruff
entry: ruff check --config enterprise/dev_config/python/ruff.toml
types_or: [python, pyi, jupyter]
args: [--fix]
files: ^enterprise/
# Run the formatter.
- id: ruff-format
entry: ruff format --config enterprise/dev_config/python/ruff.toml
types_or: [python, pyi, jupyter]
files: ^enterprise/
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
- id: mypy
additional_dependencies:
- types-requests
- types-setuptools
- types-pyyaml
- types-toml
- types-redis
- lxml
# OpenHands package in repo root
- ./
- stripe==11.5.0
- pygithub==2.6.1
# To see gaps add `--html-report mypy-report/`
entry: mypy --config-file enterprise/dev_config/python/mypy.ini enterprise/
always_run: true
pass_filenames: false
files: ^enterprise/