-
Notifications
You must be signed in to change notification settings - Fork 117
/
.pre-commit-config.yaml
115 lines (115 loc) · 3.52 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
exclude: '^(.*egg.info.*|.*/parameters.py|docs/).*$'
default_language_version:
python: python3.9
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--multi-line", "3",
"--trailing-comma",
"--force-grid-wrap", "0",
"--use-parentheses",
"--ensure-newline-before-comments",
"--line-length", "88",
"--combine-as",
"--project", "snowflake.connector",
"--project", "snowflake.snowpark",
"--diff"
]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args:
- --safe
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
# Indentend, multiline markdown comments require leading whitespace to
# preserve indentation for subsequent lines.
exclude: >
(?x)^(
.*\.md
)$
- id: end-of-file-fixer
exclude: >
(?x)^(
license_header.txt|
tests/resources/.*|
)$
- id: check-yaml
# The first two lines of meta.yaml does not work with check-yaml
exclude: >
(?x)^(
recipe/meta.yaml|
.github/repo_meta.yaml|
)$
- id: debug-statements
- id: check-ast
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
rev: v1.1.13
hooks:
- id: insert-license
name: insert-py-license
files: >
(?x)^(
src/snowflake/snowpark/.*\.py|
tests/.*\.py|
)$
exclude: >
(?x)^(
src/snowflake/snowpark/version.py|
tests/resources/.*\.py|
)$
args:
- --license-filepath
- license_header.txt
- repo: https://github.com/pycqa/flake8.git
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-init-return == 1.0.0
- flake8-print
args:
- --per-file-ignores=tests/*.py:T201 # prints are allowed in test files
# Ignore errors for generated protocol buffer stubs
- --exclude=src/snowflake/snowpark/_internal/proto/generated/ast_pb2.py
# Use mypy for static type checking.
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.991'
hooks:
- id: mypy
files: >
(?x)^(
src/snowflake/snowpark/_internal/ast/.*\.py|
src/snowflake/snowpark/modin/pandas/indexing.py|
src/snowflake/snowpark/modin/plugin/_internal/.*\.py|
src/snowflake/snowpark/modin/pandas/snow_partition_iterator.py|
src/snowflake/snowpark/modin/plugin/compiler/snowflake_query_compiler.py|
src/snowflake/snowpark/modin/plugin/utils/.*\.py|
)$
args:
- --disallow-untyped-calls
- --disallow-untyped-defs
- --disallow-incomplete-defs
additional_dependencies:
- types-requests
- types-python-dateutil
- types-urllib3
- types-setuptools
- types-pyOpenSSL
- types-setuptools
- mypy-protobuf
- typed-ast
- pytest
- numpy