forked from pyth-network/pyth-crosschain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
129 lines (129 loc) · 5.81 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
exclude: target_chains/sui/vendor/
- id: end-of-file-fixer
exclude: target_chains/sui/vendor/
- id: check-added-large-files
exclude: package-lock.json,target_chains/sui/vendor/
# Hook to format many type of files in the repo
# including solidity contracts.
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.7.1"
hooks:
- id: prettier
additional_dependencies:
exclude: target_chains/sui/vendor/
- repo: local
hooks:
# Hooks for the remote executor
- id: cargo-fmt-remote-executor
name: Cargo format for remote executor
language: "rust"
entry: cargo +nightly-2023-03-01 fmt --manifest-path ./governance/remote_executor/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: governance/remote_executor
- id: cargo-clippy-remote-executor
name: Cargo clippy for remote executor
language: "rust"
entry: cargo +nightly-2023-03-01 clippy --manifest-path ./governance/remote_executor/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: governance/remote_executor
# Hooks for cosmwasm contract
- id: cargo-fmt-cosmwasm
name: Cargo format for cosmwasm contract
language: "rust"
entry: cargo +nightly-2023-03-01 fmt --manifest-path ./target_chains/cosmwasm/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: target_chains/cosmwasm
- id: cargo-clippy-cosmwasm
name: Cargo clippy for cosmwasm contract
language: "rust"
entry: cargo +nightly-2023-03-01 clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: target_chains/cosmwasm
# Hooks for Hermes
- id: cargo-fmt-hermes
name: Cargo format for Hermes
language: "rust"
entry: cargo +nightly-2024-03-26 fmt --manifest-path ./apps/hermes/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: apps/hermes
- id: cargo-clippy-hermes
name: Cargo clippy for Hermes
language: "rust"
entry: cargo +nightly-2024-03-26 clippy --manifest-path ./apps/hermes/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: apps/hermes
# Hooks for Fortuna
- id: cargo-fmt-fortuna
name: Cargo format for Fortuna
language: "rust"
entry: cargo +nightly-2023-07-23 fmt --manifest-path ./apps/fortuna/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: apps/fortuna
# Hooks for message buffer contract
- id: cargo-fmt-message-buffer
name: Cargo format for message buffer contract
language: "rust"
entry: cargo +nightly-2023-03-01 fmt --manifest-path ./pythnet/message_buffer/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: pythnet/message_buffer
- id: cargo-clippy-message-buffer
name: Cargo clippy for message buffer contract
language: "rust"
entry: cargo +nightly-2023-03-01 clippy --manifest-path ./pythnet/message_buffer/Cargo.toml --tests --fix --allow-dirty --allow-staged --features test-bpf -- -D warnings
pass_filenames: false
files: pythnet/message_buffer
# Hooks for pythnet_sdk
- id: cargo-fmt-pythnet-sdk
name: Cargo format for pythnet SDK
language: "rust"
entry: cargo +nightly-2024-03-26 fmt --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: pythnet/pythnet_sdk
- id: cargo-clippy-pythnet-sdk
name: Cargo clippy for pythnet SDK
language: "rust"
entry: cargo +nightly-2024-03-26 clippy --manifest-path ./pythnet/pythnet_sdk/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: pythnet/pythnet_sdk
# Hooks for solana receiver contract
- id: cargo-fmt-pyth-solana-receiver
name: Cargo format for solana target chain contract
language: "rust"
entry: cargo +nightly-2023-03-01 fmt --manifest-path ./target_chains/solana/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: target_chains/solana
- id: cargo-clippy-pyth-solana-receiver
name: Cargo clippy for solana target chain contract
language: "rust"
entry: cargo +nightly-2023-03-01 clippy --manifest-path ./target_chains/solana/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: target_chains/solana
# For express relay python files
- id: poetry-install
name: poetry install
entry: poetry -C express_relay/sdk/python/express_relay install
pass_filenames: false
files: express_relay/sdk/python/express_relay
language: "system"
- id: black
name: black
entry: poetry -C express_relay/sdk/python/express_relay run black
files: express_relay/sdk/python/express_relay
language: "system"
- id: pyflakes
name: pyflakes
entry: poetry -C express_relay/sdk/python/express_relay run pyflakes
files: express_relay/sdk/python/express_relay
language: "system"
- id: mypy
name: mypy
entry: poetry -C express_relay/sdk/python/express_relay run mypy
files: express_relay/sdk/python/express_relay
language: "system"