-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathprek.toml
More file actions
77 lines (68 loc) · 3.23 KB
/
Copy pathprek.toml
File metadata and controls
77 lines (68 loc) · 3.23 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
# SPDX-FileCopyrightText: © 2025 Phala Network <dstack@phala.network>
#
# SPDX-License-Identifier: Apache-2.0
# =============================================================================
# prek configuration for dstack
# =============================================================================
# --- General hooks (trailing whitespace, file checks, etc.) ---
[[repos]]
repo = "https://github.com/pre-commit/pre-commit-hooks"
rev = "v5.0.0"
hooks = [
{ id = "trailing-whitespace", args = ["--markdown-linebreak-ext=md"], exclude = '^(os/yocto/|tools/(dev-stack\.sh|vm-runner/)|dstack/(dstack-util/tests/fixtures/key-provider-docker-compose\.yaml|gateway/src/main_service/snapshots/.*))' },
{ id = "end-of-file-fixer", exclude = "^(os/yocto/|tools/(dev-stack\\.sh|vm-runner/))" },
{ id = "check-yaml", args = ["--allow-multiple-documents"], exclude = "dstack/gateway/templates/" },
{ id = "check-toml" },
{ id = "check-json" },
{ id = "check-merge-conflict" },
{ id = "check-added-large-files", args = ["--maxkb=500"] },
{ id = "check-symlinks" },
{ id = "mixed-line-ending", args = ["--fix=lf"], exclude = "^(os/yocto/|tools/(dev-stack\\.sh|vm-runner/))" },
]
# --- Rust: rustfmt ---
[[repos]]
repo = "local"
[[repos.hooks]]
id = "cargo-fmt"
name = "cargo fmt"
entry = "cargo fmt --manifest-path dstack/Cargo.toml --all"
language = "system"
types = ["rust"]
pass_filenames = false
# --- Python: ruff (lint + format) ---
# dstack-cloud and the imported Yocto/legacy tools follow their upstream styles;
# exclude them so this repository does not create unrelated formatting churn.
[[repos]]
repo = "https://github.com/astral-sh/ruff-pre-commit"
rev = "v0.11.4"
hooks = [
{ id = "ruff", args = ["--fix", "--select", "E,F,I,D", "--ignore", "D203,D213,E501"], exclude = "^(dstack/scripts/bin/dstack-cloud|os/yocto/|tools/vm-runner/)" },
{ id = "ruff-format", exclude = "^(dstack/scripts/bin/dstack-cloud|os/yocto/|tools/vm-runner/)" },
]
# --- Go: go vet ---
[[repos]]
repo = "local"
[[repos.hooks]]
id = "go-vet"
name = "go vet"
entry = "bash -c 'cd sdk/go && go vet ./...'"
language = "system"
files = "sdk/go/.*\\.go$"
pass_filenames = false
# --- Shell: shellcheck ---
[[repos]]
repo = "https://github.com/shellcheck-py/shellcheck-py"
rev = "v0.10.0.1"
hooks = [
# The imported Yocto backend retains its upstream shell style. New common
# OS scripts remain covered by this hook. The explicit legacy list records
# pre-existing shellcheck debt exposed when the files moved into dstack/.
{ id = "shellcheck", exclude = '^(os/yocto/.*|tools/(dev-stack\.sh|vm-runner/.*)|dstack/(build/shared/config-qemu\.sh|cargo-check-all\.sh|gateway/test-run/(cluster\.sh|e2e/run-e2e\.sh|test_certbot\.sh)|guest-agent-simulator/install-systemd\.sh|kms/auth-eth/run-tests\.sh|scripts/(config-fw\.sh|setup-bridge\.sh)|supervisor/tests/(test-cli\.sh|test\.sh)|test-scripts/(get-app-key\.sh|inspect-cert\.sh)|verifier/test\.sh|vmm/(src/setup-user\.sh|src/tests/test-deployment\.sh|ui/scripts/build_proto\.sh|venv\.sh)))$' },
]
# --- Conventional commits (used by cliff.toml for changelog) ---
[[repos]]
repo = "https://github.com/compilerla/conventional-pre-commit"
rev = "v4.1.0"
hooks = [
{ id = "conventional-pre-commit", stages = ["commit-msg"] },
]