forked from pyth-network/per
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
118 lines (118 loc) · 4.38 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
exclude: package-lock.json
# 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:
- repo: local
hooks:
# Hooks for auction server
- id: cargo-fmt-auction-server
name: Cargo format for auction server
language: "rust"
entry: cargo +nightly-2024-04-10 fmt --manifest-path ./auction-server/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: auction-server
- id: cargo-clippy-auction-server
name: Cargo clippy for auction server
language: "rust"
entry: cargo +stable clippy --manifest-path ./auction-server/Cargo.toml --tests -- -D warnings
pass_filenames: false
files: auction-server
# Hooks for vault-simulator
- id: cargo-fmt-vault-simulator
name: Cargo format for vault simulator
language: "rust"
entry: cargo +nightly-2024-04-10 fmt --manifest-path ./vault-simulator/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: vault-simulator
- id: cargo-clippy-vault-simulator
name: Cargo clippy for vault simulator
language: "rust"
entry: cargo +stable clippy --manifest-path ./vault-simulator/Cargo.toml --tests -- -D warnings
pass_filenames: false
files: vault-simulator
# Hooks for gas-oracle
- id: cargo-fmt-gas-oracle
name: Cargo format for gas oracle
language: "rust"
entry: cargo +nightly-2024-04-10 fmt --manifest-path ./gas-oracle/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: gas-oracle
- id: cargo-clippy-gas-oracle
name: Cargo clippy for gas oracle
language: "rust"
entry: cargo +stable clippy --manifest-path ./gas-oracle/Cargo.toml --tests -- -D warnings
pass_filenames: false
files: gas-oracle
# Hooks for contracts-svm
- id: cargo-fmt-contracts-svm
name: Cargo format for svm contracts
language: "rust"
entry: cargo +nightly-2024-04-10 fmt --manifest-path ./contracts/svm/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: contracts/svm
- id: cargo-clippy-contracts-svm
name: Cargo clippy for svm contracts
language: "rust"
entry: cargo +stable clippy --manifest-path ./contracts/svm/Cargo.toml --tests -- -D warnings
pass_filenames: false
files: contracts/svm
# EsLint hooks
- id: eslint-limonade
name: eslint limonade
entry: npm run --prefix scripts/limonade lint
pass_filenames: false
language: system
files: scripts/limonade/
- id: eslint-js-sdk
name: eslint js sdk
entry: npm run --prefix sdk/js lint
pass_filenames: false
language: system
files: sdk/js/
- id: eslint-dex-router
name: eslint dex-router
entry: npm run --prefix scripts/dex-router lint
pass_filenames: false
language: system
files: scripts/dex-router
- id: eslint-opp-provider-limo
name: eslint opp-provider-limo
entry: npm run --prefix scripts/opportunity-provider-limo lint
pass_filenames: false
language: system
files: scripts/opportunity-provider-limo
- id: eslint-opp-provider
name: eslint opp-provider
entry: npm run --prefix scripts/opportunity-provider lint
pass_filenames: false
language: system
files: scripts/opportunity-provider
# For python files
- id: isort
name: isort
entry: poetry -C per_sdk run isort --profile=black per_sdk
pass_filenames: false
language: system
- id: black
name: black
entry: poetry -C per_sdk run black per_sdk
pass_filenames: false
language: system
- id: pyflakes
name: pyflakes
entry: poetry -C per_sdk run pyflakes per_sdk
pass_filenames: false
language: system