forked from snowflakedb/snowflake-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
62 lines (62 loc) · 2.06 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
exclude: '(^tests/|^tests_integration/|^tests_e2e)'
- id: end-of-file-fixer
exclude: license_header.txt
- id: check-yaml
exclude: .github/repo_meta.yaml
- id: debug-statements
exclude: src/snowflake/cli/app/dev/pycharm_remote_debug.py
- id: check-ast
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.1.7"
hooks:
- id: ruff
args: [--fix, --exclude, "**/tests_integration/"]
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.990
hooks:
- id: mypy
additional_dependencies: [types-all]
- repo: local
hooks:
- id: check-print-in-code
language: pygrep
name: "Check for print statements"
entry: "print\\(|echo\\("
pass_filenames: true
files: ^src/snowflake/.*\.py$
exclude: >
(?x)
^src/snowflake/cli/api/console/.*$|
^src/snowflake/cli/app/printing.py$|
^src/snowflake/cli/app/dev/.*$|
^src/snowflake/cli/templates/.*$|
^src/snowflake/cli/api/utils/rendering.py$|
^src/snowflake/cli/plugins/spcs/common.py$|
^src/snowflake/cli/plugins/snowpark/venv.py$
- id: check-app-imports-in-api
language: pygrep
name: "No top level cli.app imports in cli.api"
entry: "^from snowflake\\.cli\\.app"
pass_filenames: true
files: ^src/snowflake/cli/api/.*\.py$
- id: avoid-snowcli
language: pygrep
name: "Prefer snowflake CLI over snowcli"
entry: "snowcli"
pass_filenames: true
files: ^src/.*\.py$
exclude: ^src/snowflake/cli/app/telemetry.py$
- id: dependencies-sync
name: "Copy dependencies from pyproject.toml to requirements.txt"
language: system
entry: python snyk/dependency-sync.py
files: ^pyproject.toml$