.pre-commit-config.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. repos:
  2. - repo: https://github.com/pre-commit/pre-commit-hooks
  3. rev: v4.5.0
  4. hooks:
  5. - id: trailing-whitespace
  6. exclude: docs/modules/python
  7. - id: end-of-file-fixer
  8. exclude: docs/modules/python
  9. - id: check-yaml
  10. - id: debug-statements
  11. - repo: https://github.com/tox-dev/pyproject-fmt
  12. rev: 1.7.0
  13. hooks:
  14. - id: pyproject-fmt
  15. - repo: https://github.com/abravalheri/validate-pyproject
  16. rev: v0.16
  17. hooks:
  18. - id: validate-pyproject
  19. - repo: https://github.com/astral-sh/ruff-pre-commit
  20. # Ruff version.
  21. rev: v0.4.1
  22. hooks:
  23. # Run the linter.
  24. - id: ruff
  25. entry: ruff check --config dev_config/python/ruff.toml
  26. types_or: [python, pyi, jupyter]
  27. args: [--fix]
  28. # Run the formatter.
  29. - id: ruff-format
  30. entry: ruff format --config dev_config/python/ruff.toml
  31. types_or: [python, pyi, jupyter]
  32. - repo: https://github.com/pre-commit/mirrors-mypy
  33. rev: v1.9.0
  34. hooks:
  35. - id: mypy
  36. additional_dependencies:
  37. [types-requests, types-setuptools, types-pyyaml, types-toml]
  38. entry: mypy --config-file dev_config/python/mypy.ini openhands/
  39. always_run: true
  40. pass_filenames: false