1
+ # Copyright 2022 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ ---
16
+ default_stages : [commit, push]
17
+ default_language_version :
18
+ # force all unspecified python hooks to run python3
19
+ python : python3
20
+ minimum_pre_commit_version : " 1.20.0"
21
+ repos :
22
+ - repo : https://github.com/psf/black
23
+ rev : 22.3.0
24
+ hooks :
25
+ - id : black
26
+ args : [--config=pyproject.toml]
27
+ - repo : https://github.com/asottile/blacken-docs
28
+ rev : v1.12.1
29
+ hooks :
30
+ - id : blacken-docs
31
+ alias : black
32
+ additional_dependencies : [black==22.3.0]
33
+ - repo : https://github.com/PyCQA/isort
34
+ rev : 5.10.1
35
+ hooks :
36
+ - id : isort
37
+ name : Run isort to sort imports in Python files
38
+ files : \.py$|\.pyi$
39
+ exclude : ^build/.*$|^\.tox/.*$|^venv/.*$
40
+ - repo : https://github.com/pycqa/pydocstyle
41
+ rev : 6.1.1
42
+ hooks :
43
+ - id : pydocstyle
44
+ name : Run pydocstyle to check compliance with Python docstring conventions
45
+ args :
46
+ - --convention=pep257
47
+ - --add-ignore=D100,D102,D103,D104,D105,D107,D202,D205,D400,D401
48
+ exclude : |
49
+ (?x)
50
+ ^tests/.*\.py$|
51
+ additional_dependencies : ['toml']
52
+ - repo : https://github.com/codespell-project/codespell
53
+ rev : v2.1.0
54
+ hooks :
55
+ - id : codespell
56
+ name : Run codespell to check for common misspellings in files
57
+ entry : bash -c 'echo "If you think that this failure is an error, consider adding the word(s)
58
+ to the codespell dictionary at docs/spelling_wordlist.txt.
59
+ The word(s) should be in lowercase." && exec codespell "$@"' --
60
+ language : python
61
+ types : [text]
62
+ - repo : local
63
+ hooks :
64
+ - id : markdownlint
65
+ name : Run markdownlint to check the style of Markdown files
66
+ description : Checks the style of Markdown files.
67
+ entry : markdownlint
68
+ language : node
69
+ types : [markdown]
70
+ files : \.(md|mdown|markdown)$
71
+ additional_dependencies : ['markdownlint-cli']
72
+ - repo : https://github.com/Lucas-C/pre-commit-hooks
73
+ rev : v1.1.10
74
+ hooks :
75
+ - id : insert-license
76
+ name : Add license for all Python and shell files
77
+ exclude : ^\.github/.*$
78
+ files : \.py$|\.pyi|\.bash$|\.sh$
79
+ args :
80
+ - --comment-style
81
+ - " |#|"
82
+ - --license-filepath
83
+ - scripts/LICENSE.txt
84
+ - --fuzzy-match-generates-todo
85
+ - id : insert-license
86
+ name : Add license for all rst files
87
+ exclude : ^\.github/.*$
88
+ args :
89
+ - --comment-style
90
+ - " ||"
91
+ - --license-filepath
92
+ - scripts/LICENSE.rst
93
+ - --fuzzy-match-generates-todo
94
+ files : \.rst$
95
+ - id : insert-license
96
+ name : Add license for all YAML files
97
+ exclude : ^\.github/.*$
98
+ types : [yaml]
99
+ files : \.yml$|\.yaml$
100
+ args :
101
+ - --comment-style
102
+ - " |#|"
103
+ - --license-filepath
104
+ - scripts/LICENSE.txt
105
+ - --fuzzy-match-generates-todo
0 commit comments