-
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
68 lines (64 loc) · 2.13 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
68 lines (64 loc) · 2.13 KB
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
exclude: >
(?x)(
^snuba/admin/dist/|
^snuba/admin/static/|
^snuba/protobufs/
)
repos:
- repo: local
hooks:
# Configuration for ruff exists in pyproject.toml.
- id: ruff-format
name: ruff format
entry: ruff format
language: system
types_or: [python, pyi]
require_serial: true
- id: ruff-lint
name: ruff lint
entry: ruff check --fix
language: system
types_or: [python, pyi]
require_serial: true
- id: mypy
name: mypy
entry: mypy
language: system
types: [python]
require_serial: true
# Keep in sync with [tool.mypy] exclude in pyproject.toml. pre-commit
# passes filenames explicitly, which bypasses mypy's own `exclude`, so
# these dirs must be re-excluded here to honor the same policy.
exclude: '^(rust_snuba/|tests/datasets/|tests/query/|test_distributed_migrations/)'
- id: validate-configs-syntax
name: validate-configs-syntax
entry: env SNUBA_SETTINGS=test python3 -m snuba.validate_configs
language: python
additional_dependencies: [ 'fastjsonschema', 'pyyaml', 'sentry_sdk>=2.66.1' ]
pass_filenames: false
files: 'snuba/datasets/configuration/.*'
- id: cargo-fmt
name: format rust code
language: system
# keep in sync with Cargo.toml. There is no way to run cargo fmt for specific files
# https://github.com/rust-lang/rustfmt/issues/4485
entry: rustfmt --edition 2021
files: ^rust_snuba/.*\.rs$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: check-xml
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- id: fix-encoding-pragma
args: ["--remove"]
- id: no-commit-to-branch
args: ['--branch', 'master']
- id: check-added-large-files
args: ['--maxkb=1024']