repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: - id: check-added-large-files args: ["--maxkb=500"] - id: fix-byte-order-marker - id: check-case-conflict - id: check-merge-conflict - id: check-symlinks - id: debug-statements - repo: local # isort needs the context of which packages are installed to function, so we # can't use a vendored isort pre-commit hook (which runs in its own isolated venv). hooks: - id: isort-autogpt name: Lint (isort) - AutoGPT entry: poetry -C autogpt run isort files: ^autogpt/ types: [file, python] language: system - id: isort-forge name: Lint (isort) - Forge entry: poetry -C forge run isort files: ^forge/ types: [file, python] language: system - id: isort-benchmark name: Lint (isort) - Benchmark entry: poetry -C benchmark run isort files: ^benchmark/ types: [file, python] language: system - repo: https://github.com/psf/black rev: 23.12.1 # Black has sensible defaults, doesn't need package context, and ignores # everything in .gitignore, so it works fine without any config or arguments. hooks: - id: black name: Lint (Black) language_version: python3.10 - repo: https://github.com/PyCQA/flake8 rev: 7.0.0 # To have flake8 load the config of the individual subprojects, we have to call # them separately. hooks: - id: flake8 name: Lint (Flake8) - AutoGPT alias: flake8-autogpt files: ^autogpt/(autogpt|scripts|tests)/ args: [--config=autogpt/.flake8] - id: flake8 name: Lint (Flake8) - Forge alias: flake8-forge files: ^forge/(forge|tests)/ args: [--config=forge/.flake8] - id: flake8 name: Lint (Flake8) - Benchmark alias: flake8-benchmark files: ^benchmark/(agbenchmark|tests)/((?!reports).)*[/.] args: [--config=benchmark/.flake8] - repo: local # To have watertight type checking, we check *all* the files in an affected # project. To trigger on poetry.lock we also reset the file `types` filter. hooks: - id: pyright name: Typecheck - AutoGPT alias: pyright-autogpt entry: poetry -C autogpt run pyright args: [-p, autogpt, autogpt] # include forge source (since it's a path dependency) but exclude *_test.py files: files: ^(autogpt/((autogpt|scripts|tests)/|poetry\.lock$)|forge/(forge/.*(?