-
Notifications
You must be signed in to change notification settings - Fork 44
/
.pre-commit-config.yaml
68 lines (61 loc) · 1.94 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# pre-commit.ci configuration
ci:
autofix_prs: false
autoupdate_branch: 'main'
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: monthly
# Both of these require `invoke` to be installed in the environment
skip: [json-diff, update-docs-api-reference]
submodules: true
default_language_version:
python: python3.10
# pre-commit hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-symlinks
- id: check-yaml
name: Check YAML
- id: check-json
- id: destroyed-symlinks
- id: end-of-file-fixer
- id: requirements-txt-fixer
name: Fix requirements*.txt
files: ^requirements.*\.txt$
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.7.2'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: local
hooks:
- id: json-diff
name: OpenAPI diff
description: Check for differences in openapi.json and index_openapi.json with local versions.
entry: invoke check-openapi-diff
pass_filenames: false
language: python
- id: update-docs-api-reference
name: Update API Reference in Documentation
entry: invoke create-api-reference-docs --pre-clean --pre-commit
language: python
pass_filenames: false
files: ^optimade/.*\.py$
description: Update the API Reference documentation whenever a Python file is touched in the code base.
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
name: "MyPy"
additional_dependencies: ["types-requests", "types-pyyaml", "pydantic~=2.0"]
exclude: ^tests/.*$
args: [--check-untyped-defs]