-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
102 lines (91 loc) · 2.96 KB
/
.pre-commit-config.yaml
File metadata and controls
102 lines (91 loc) · 2.96 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
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
repos:
# General hooks for all file types
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-executables-have-shebangs
# Docker linting
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
files: ^.*Dockerfile.*$
args: ['--ignore', 'DL3007', '--ignore', 'DL3008', '--ignore', 'DL3013']
# Shell script linting
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
hooks:
- id: shellcheck
files: \.(sh|bash)$
# Python formatting and linting
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
language_version: python3
files: \.(py|pyi)$
- repo: https://github.com/pycqa/isort
rev: 5.13.2 # last version of isort that supports python 3.8
hooks:
- id: isort
name: isort (python)
files: ^asap-tools/data-sources/prometheus-exporters/.*\.py$
args: ["--settings-file", "asap-tools/data-sources/prometheus-exporters/.isort.cfg"]
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
files: \.(py|pyi)$
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.14.1"
hooks:
- id: mypy
files: ^asap-tools/data-sources/prometheus-exporters/.*\.py$
args: [--config-file=asap-tools/data-sources/prometheus-exporters/.mypy.ini]
- id: mypy
files: ^asap-tools/queriers/prometheus-client/
args: [--config-file=asap-tools/queriers/prometheus-client/pyproject.toml]
additional_dependencies:
- types-requests
- types-PyYAML
- typing-extensions
- numpy
- prometheus-client
- urllib3
# Rust formatting, linting, and tests (workspace-level)
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
description: Format all Rust workspace crates with rustfmt.
entry: bash -c 'cargo fmt --all -- --check'
language: system
files: \.rs$
pass_filenames: false
- id: cargo-check
name: cargo check
description: Check the workspace for errors.
entry: bash -c 'cargo check --workspace'
language: system
files: \.rs$
pass_filenames: false
- id: cargo-clippy
name: cargo clippy
description: Lint all Rust workspace crates.
entry: bash -c 'cargo clippy --workspace --all-targets --all-features -- -D warnings'
language: system
files: \.rs$
pass_filenames: false
- id: cargo-test
name: cargo test
description: Run all Rust workspace tests.
entry: bash -c 'cargo test --workspace'
language: system
files: \.rs$
pass_filenames: false