2019-06-25 19:40:27 +03:00
|
|
|
repos:
|
|
|
|
- repo: https://github.com/python/black
|
2022-02-08 05:18:16 +03:00
|
|
|
rev: 22.1.0
|
2019-06-25 19:40:27 +03:00
|
|
|
hooks:
|
|
|
|
- id: black
|
2019-09-25 23:12:44 +03:00
|
|
|
exclude: >
|
|
|
|
(?x)^(
|
|
|
|
.*_pb2.py|
|
2022-02-08 05:18:16 +03:00
|
|
|
.*_pb2.pyi|
|
2019-09-25 23:12:44 +03:00
|
|
|
.*_pb2_grpc.py
|
|
|
|
)$
|
2019-10-12 02:18:54 +03:00
|
|
|
|
2019-06-26 02:56:48 +03:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
2022-02-08 05:18:16 +03:00
|
|
|
rev: v0.931
|
2019-06-26 02:56:48 +03:00
|
|
|
hooks:
|
|
|
|
- id: mypy
|
|
|
|
name: mypy-ml-agents
|
|
|
|
files: "ml-agents/.*"
|
2022-02-08 05:18:16 +03:00
|
|
|
args: [--ignore-missing-imports, --disallow-incomplete-defs, --no-strict-optional]
|
|
|
|
additional_dependencies: [types-PyYAML, types-attrs, types-protobuf, types-setuptools]
|
2019-06-26 02:56:48 +03:00
|
|
|
- id: mypy
|
|
|
|
name: mypy-ml-agents-envs
|
|
|
|
files: "ml-agents-envs/.*"
|
|
|
|
# Exclude protobuf files and don't follow them when imported
|
2019-07-09 02:36:30 +03:00
|
|
|
exclude: ".*_pb2.py"
|
2022-02-08 05:18:16 +03:00
|
|
|
args: [--ignore-missing-imports, --disallow-incomplete-defs, --no-strict-optional]
|
|
|
|
additional_dependencies: [types-PyYAML, types-attrs, types-protobuf, types-setuptools]
|
2020-05-13 20:57:53 +03:00
|
|
|
- repo: https://gitlab.com/pycqa/flake8
|
2022-02-08 05:18:16 +03:00
|
|
|
rev: 3.9.2
|
2020-05-13 20:57:53 +03:00
|
|
|
hooks:
|
|
|
|
- id: flake8
|
|
|
|
exclude: >
|
|
|
|
(?x)^(
|
|
|
|
.*_pb2.py|
|
|
|
|
.*_pb2_grpc.py
|
|
|
|
)$
|
|
|
|
# flake8-tidy-imports is used for banned-modules, not actually tidying
|
|
|
|
additional_dependencies: [flake8-comprehensions==3.2.2, flake8-tidy-imports==4.1.0, flake8-bugbear==20.1.4]
|
|
|
|
|
2020-07-17 04:00:56 +03:00
|
|
|
- repo: https://github.com/asottile/pyupgrade
|
2022-02-08 05:18:16 +03:00
|
|
|
rev: v2.31.0
|
2020-07-17 04:00:56 +03:00
|
|
|
hooks:
|
|
|
|
- id: pyupgrade
|
2020-07-17 07:14:54 +03:00
|
|
|
args: [--py3-plus, --py36-plus]
|
2020-07-29 21:59:32 +03:00
|
|
|
exclude: >
|
|
|
|
(?x)^(
|
|
|
|
.*_pb2.py|
|
|
|
|
.*_pb2_grpc.py
|
|
|
|
)$
|
2020-07-17 04:00:56 +03:00
|
|
|
|
2019-07-02 00:56:38 +03:00
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2022-02-08 05:18:16 +03:00
|
|
|
rev: v4.1.0
|
2019-07-02 00:56:38 +03:00
|
|
|
hooks:
|
|
|
|
- id: mixed-line-ending
|
|
|
|
exclude: >
|
|
|
|
(?x)^(
|
|
|
|
.*cs.meta|
|
2019-09-26 01:51:18 +03:00
|
|
|
.*.css|
|
|
|
|
.*.meta
|
2019-07-02 00:56:38 +03:00
|
|
|
)$
|
2019-07-09 01:55:24 +03:00
|
|
|
args: [--fix=lf]
|
2020-05-13 20:57:53 +03:00
|
|
|
|
2019-10-24 01:59:36 +03:00
|
|
|
- id: trailing-whitespace
|
|
|
|
name: trailing-whitespace-markdown
|
|
|
|
types: [markdown]
|
2019-11-15 02:03:59 +03:00
|
|
|
- id: check-merge-conflict
|
|
|
|
args: [--assume-in-merge]
|
2019-12-17 00:59:36 +03:00
|
|
|
- id: check-yaml
|
|
|
|
# Won't handle the templating in yamato
|
2021-02-17 20:28:56 +03:00
|
|
|
exclude: \.yamato/.*
|
2019-10-12 02:18:54 +03:00
|
|
|
|
|
|
|
- repo: https://github.com/pre-commit/pygrep-hooks
|
2022-02-08 05:18:16 +03:00
|
|
|
rev: v1.9.0
|
2019-10-12 02:18:54 +03:00
|
|
|
hooks:
|
|
|
|
- id: python-check-mock-methods
|
|
|
|
|
2020-04-23 00:56:24 +03:00
|
|
|
- repo: https://github.com/mattlqx/pre-commit-search-and-replace
|
2022-02-08 05:18:16 +03:00
|
|
|
rev: v1.0.5
|
2020-04-23 00:56:24 +03:00
|
|
|
hooks:
|
|
|
|
- id: search-and-replace
|
|
|
|
types: [markdown]
|
|
|
|
exclude: ".*localized.*"
|
|
|
|
|
2021-03-16 04:33:01 +03:00
|
|
|
- repo: https://github.com/dotnet/format
|
2021-09-03 01:06:49 +03:00
|
|
|
rev: v5.1.225507
|
2021-03-16 04:33:01 +03:00
|
|
|
hooks:
|
|
|
|
- id: dotnet-format
|
2021-09-03 01:06:49 +03:00
|
|
|
entry: dotnet-format whitespace
|
2021-03-16 04:33:01 +03:00
|
|
|
args: [--folder, --include]
|
|
|
|
|
2019-09-13 00:32:27 +03:00
|
|
|
# "Local" hooks, see https://pre-commit.com/#repository-local-hooks
|
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: markdown-link-check
|
|
|
|
name: markdown-link-check
|
2020-04-27 23:19:06 +03:00
|
|
|
entry: utils/run_markdown_link_check.py
|
|
|
|
language: script
|
2019-09-13 00:32:27 +03:00
|
|
|
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]
|
2019-10-29 02:09:26 +03:00
|
|
|
- id: markdown-link-check-full
|
|
|
|
name: markdown-link-check-full
|
2020-04-27 23:19:06 +03:00
|
|
|
entry: utils/run_markdown_link_check.py
|
|
|
|
language: script
|
2019-10-29 02:09:26 +03:00
|
|
|
types: [markdown]
|
2020-04-27 23:19:06 +03:00
|
|
|
# Don't check localized files since their target might not be localized.
|
2019-10-29 02:09:26 +03:00
|
|
|
exclude: ".*localized.*"
|
2020-04-27 23:19:06 +03:00
|
|
|
# Only run manually, e.g. pre-commit run --hook-stage manual markdown-link-check-full
|
2019-10-29 02:09:26 +03:00
|
|
|
stages: [manual]
|
2020-04-27 23:19:06 +03:00
|
|
|
args: [--check-remote]
|
2019-10-25 00:02:23 +03:00
|
|
|
- id: validate-versions
|
|
|
|
name: validate library versions
|
|
|
|
language: script
|
|
|
|
entry: utils/validate_versions.py
|
2019-11-22 23:50:41 +03:00
|
|
|
files: ".*/__init__.py"
|
2020-03-03 00:58:08 +03:00
|
|
|
- id: validate-init-py
|
|
|
|
name: validate __init__.py files
|
|
|
|
language: script
|
|
|
|
entry: utils/validate_inits.py
|
|
|
|
types: [python]
|
2020-06-23 21:05:49 +03:00
|
|
|
- id: validate-release-links-py
|
|
|
|
name: validate release links
|
|
|
|
language: script
|
|
|
|
entry: utils/validate_release_links.py
|
2021-06-01 19:51:16 +03:00
|
|
|
require_serial: true
|
2021-05-19 15:47:53 +03:00
|
|
|
- id: generate-markdown-docs
|
|
|
|
name: generate markdown docs
|
2021-05-25 03:51:37 +03:00
|
|
|
language: python
|
|
|
|
entry: ./utils/generate_markdown_docs.py --package_dirs ml-agents-envs
|
2021-05-19 15:47:53 +03:00
|
|
|
pass_filenames: false
|
2021-05-25 03:51:37 +03:00
|
|
|
additional_dependencies: [pyyaml, pydoc-markdown==3.10.1]
|