mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 06:48:02 -05:00
Adding pre-commit and CI for ruff and mypy (#69)
* don't modify directories * oops typo * dev_config/python * add config to CI * bump CI python to 3.10 * 3.11? * del actions/ * add suggestions * delete unused code * missed some * oops missed another one * remove a file
This commit is contained in:
17
dev_config/python/.pre-commit-config.yaml
Normal file
17
dev_config/python/.pre-commit-config.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.3.3
|
||||
hooks:
|
||||
- id: ruff
|
||||
entry: ruff check --config dev_config/python/ruff.toml opendevin/ server/ agenthub/
|
||||
always_run: true
|
||||
pass_filenames: false
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.9.0
|
||||
hooks:
|
||||
- id: mypy
|
||||
additional_dependencies: [types-requests, types-setuptools]
|
||||
entry: mypy --config-file dev_config/python/mypy.ini opendevin/ server/ agenthub/
|
||||
always_run: true
|
||||
pass_filenames: false
|
||||
11
dev_config/python/mypy.ini
Normal file
11
dev_config/python/mypy.ini
Normal file
@@ -0,0 +1,11 @@
|
||||
[mypy]
|
||||
warn_unused_configs = True
|
||||
ignore_missing_imports = True
|
||||
check_untyped_defs = True
|
||||
explicit_package_bases = True
|
||||
warn_unreachable = True
|
||||
warn_redundant_casts = True
|
||||
no_implicit_optional = True
|
||||
strict_optional = True
|
||||
|
||||
exclude = agenthub/langchains_agent/regression
|
||||
3
dev_config/python/ruff.toml
Normal file
3
dev_config/python/ruff.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
exclude = [
|
||||
"agenthub/langchains_agent/regression/",
|
||||
]
|
||||
Reference in New Issue
Block a user