repos: - repo: https://github.com/python/black rev: 19.3b0 hooks: - id: black exclude: > (?x)^( .*_pb2.py| .*_pb2_grpc.py )$ - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.750 # Currently mypy may assert after logging one message. To get all the messages at once, change repo and rev to # repo: https://github.com/chriselion/mypy # rev: 3d0b6164a9487a6c5cf9d144110b86600fd85e25 # This is a fork with the assert disabled, although precommit has trouble installing it sometimes. hooks: - id: mypy name: mypy-ml-agents files: "ml-agents/.*" args: [--ignore-missing-imports, --disallow-incomplete-defs, --namespace-packages] - id: mypy name: mypy-ml-agents-envs files: "ml-agents-envs/.*" # Exclude protobuf files and don't follow them when imported exclude: ".*_pb2.py" args: [--ignore-missing-imports, --disallow-incomplete-defs, --namespace-packages] - id: mypy name: mypy-gym-unity files: "gym-unity/.*" args: [--ignore-missing-imports, --disallow-incomplete-defs, --namespace-packages] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.4.0 hooks: - id: mixed-line-ending exclude: > (?x)^( .*cs.meta| .*.css| .*.meta )$ args: [--fix=lf] - id: flake8 exclude: > (?x)^( .*_pb2.py| .*_pb2_grpc.py )$ # flake8-tidy-imports is used for banned-modules, not actually tidying additional_dependencies: [flake8-comprehensions, flake8-tidy-imports] - id: trailing-whitespace name: trailing-whitespace-markdown types: [markdown] - id: check-merge-conflict args: [--assume-in-merge] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.4.2 hooks: - id: python-check-mock-methods - repo: https://github.com/pre-commit/mirrors-pylint rev: v2.4.4 hooks: - id: pylint exclude: > (?x)^( .*_pb2.py| .*_pb2_grpc.py| .*/tests/.* )$ args: [--score=n] # "Local" hooks, see https://pre-commit.com/#repository-local-hooks - repo: local hooks: - id: markdown-link-check name: markdown-link-check # markdown-link-check doesn't support multiple files on the commandline, so this hacks around that. # Note that you must install the package separately via npm. For example: # brew install npm; npm install -g markdown-link-check entry: bash -xc 'echo "$@" | xargs -n1 -t markdown-link-check -c markdown-link-check.fast.json' -- language: system types: [markdown] # Don't check localized files since their target might not be localized. exclude: ".*localized.*" # Only run manually, e.g. pre-commit run --hook-stage manual markdown-link-check stages: [manual] - id: markdown-link-check-full name: markdown-link-check-full entry: bash -xc 'echo "$@" | xargs -n1 -t markdown-link-check -c markdown-link-check.full.json' -- language: system types: [markdown] exclude: ".*localized.*" stages: [manual] - id: validate-versions name: validate library versions language: script entry: utils/validate_versions.py files: ".*/__init__.py"