.pre-commit-config.yaml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. repos:
  2. - repo: https://github.com/pre-commit/pre-commit-hooks
  3. rev: v4.5.0
  4. hooks:
  5. - id: trailing-whitespace
  6. - id: end-of-file-fixer
  7. - id: check-yaml
  8. - id: debug-statements
  9. - repo: https://github.com/PyCQA/flake8
  10. rev: 7.0.0
  11. hooks:
  12. - id: flake8
  13. args: ['--select=Q000'] # Q000 is the error code for single quote enforcement
  14. additional_dependencies:
  15. - flake8-quotes
  16. - repo: https://github.com/hhatto/autopep8
  17. rev: v2.1.0
  18. hooks:
  19. - id: autopep8
  20. - repo: https://github.com/asottile/setup-cfg-fmt
  21. rev: v2.5.0
  22. hooks:
  23. - id: setup-cfg-fmt
  24. always_run: true
  25. pass_filenames: false
  26. - repo: https://github.com/astral-sh/ruff-pre-commit
  27. # Ruff version.
  28. rev: v0.3.7
  29. hooks:
  30. # Run the linter.
  31. - id: ruff
  32. entry: ruff check --config dev_config/python/ruff.toml opendevin/ agenthub/
  33. types_or: [ python, pyi, jupyter ]
  34. args: [ --fix ]
  35. # Run the formatter.
  36. - id: ruff-format
  37. entry: ruff check --config dev_config/python/ruff.toml opendevin/ agenthub/
  38. types_or: [ python, pyi, jupyter ]
  39. - repo: https://github.com/pre-commit/mirrors-mypy
  40. rev: v1.9.0
  41. hooks:
  42. - id: mypy
  43. additional_dependencies: [types-requests, types-setuptools, types-pyyaml, types-toml]
  44. entry: mypy --config-file dev_config/python/mypy.ini opendevin/ agenthub/
  45. always_run: true
  46. pass_filenames: false