forked from talkiq/gcloud-aio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
153 lines (151 loc) · 4.28 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents]
- id: detect-private-key
exclude: (auth/tests/unit/token_test.py)|(storage/gcloud/aio/storage/blob.py)
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
# python
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
- id: debug-statements
- id: double-quote-string-fixer
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/pycqa/pylint
rev: v2.8.2
hooks:
- id: pylint
additional_dependencies:
# TODO: >0.2.0
- git+https://github.com/bayesimpact/pylint_import_modules@016f79e4d2
args:
- --allowed-direct-imports="typing.*"
- --load-plugins=pylint_import_modules
- --max-line-length=79
- --max-args=10
- --score=n
- -d broad-except
- -d duplicate-code
- -d fixme
- -d import-error
- -d import-only-modules
- -d invalid-name
- -d locally-disabled
- -d missing-docstring
- -d too-few-public-methods
- -d too-many-arguments
- -d ungrouped-imports # conflicts with reorder-python-imports
- -d wrong-import-order # conflicts with reorder-python-imports
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
hooks:
- id: remove-crlf
- id: remove-tabs
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.6.0
hooks:
- id: reorder-python-imports
args: [--py26-plus]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
hooks:
- &mypy
id: mypy
name: mypy-auth
entry: env MYPYPATH=./stubs mypy
require_serial: True
additional_dependencies:
- types-cryptography
- types-jwt
- types-pkg_resources
- types-requests
args:
- --ignore-missing-imports
- --follow-imports=silent
- --show-error-codes
- --strict
- --strict-equality
- --warn-unreachable
files: auth/
exclude: (tests/.*)|(noxfile.py)
- <<: *mypy
name: mypy-bigquery
additional_dependencies:
- types-pkg_resources
- types-requests
files: bigquery/
- <<: *mypy
name: mypy-datastore
additional_dependencies:
- types-pkg_resources
- types-requests
files: datastore/
- <<: *mypy
name: mypy-kms
additional_dependencies:
- types-pkg_resources
- types-requests
files: kms/
- <<: *mypy
name: mypy-pubsub
additional_dependencies:
- types-pkg_resources
- types-requests
files: pubsub/
- <<: *mypy
name: mypy-storage
additional_dependencies:
- types-aiofiles
- types-pkg_resources
- types-requests
files: storage/
- <<: *mypy
name: mypy-taskqueue
additional_dependencies:
- types-pkg_resources
- types-requests
files: taskqueue/
- repo: https://github.com/asottile/yesqa
rev: v1.2.3
hooks:
- id: yesqa
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
args:
- --ignore=E501,W503,F401,F811
- repo: local
hooks:
- id: pytest-fixture-require-scope
name: Require explicit scope for pytest fixtures
description: 'Ensure we explicitly set pytest fixture scopes'
entry: '@pytest\.fixture( |\n|(\(\)))'
language: pygrep
types: [python]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: python-no-eval
- id: python-no-log-warn
- id: python-use-type-annotations
# rst
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal