Skip to content

Commit 98b9907

Browse files
committed
chore: move prettier formatting to individual packages
1 parent 534006d commit 98b9907

File tree

15 files changed

+234
-126
lines changed

15 files changed

+234
-126
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@ repos:
2323
target_chains/sui/vendor/|
2424
patches/
2525
)
26-
# Hook to format many type of files in the repo
27-
# including solidity contracts.
28-
- repo: https://github.com/pre-commit/mirrors-prettier
29-
rev: "v2.7.1"
30-
hooks:
31-
- id: prettier
32-
additional_dependencies:
33-
34-
35-
exclude: target_chains/sui/vendor/
3626
- repo: local
3727
hooks:
3828
# Hooks for the remote executor

.prettierignore

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
11
pnpm-lock.yaml
22
patches/
33
.turbo/
4+
target_chains/sui/vendor/
45

5-
# These apps have their own prettier config that uses a later version of
6-
# prettier
7-
#
8-
# TODO(cprussin): eventually I'll figure out how to upgrade prettier everywhere
9-
# and hook it in to pre-commit. For now, I don't want to downgrade prettier in
10-
# the packages that are using the later version, and pre-commit doesn't support
11-
# later versions of prettier directly.
12-
#
13-
# Ideally, we should probably hook up a pre-commit script to run auto-fixes in a
14-
# generic way that packages can hook into by defining lifecycle scripts, or by
15-
# using the nx task graph. Then, packages can use their own formatters /
16-
# formatter versions and can also hook up other auto-fixes like eslint, etc.
17-
#
18-
# I'll explore doing this when I get around to spending some time on our nx
19-
# build graph config.
20-
apps/api-reference
21-
apps/staking
22-
apps/insights
23-
apps/entropy-debugger
24-
governance/pyth_staking_sdk
6+
# This should stay in sync with the list of workspaces from
7+
# `pnpm-workspace.yaml`
8+
apps/*
259
packages/*
10+
apps/hermes/client/js
11+
governance/xc_admin/packages/*
12+
governance/pyth_staking_sdk
13+
price_service/sdk/js
14+
price_service/client/js
15+
pythnet/message_buffer
16+
target_chains/aptos/cli
17+
target_chains/aptos/sdk/js
18+
target_chains/cosmwasm/tools
19+
target_chains/cosmwasm/deploy-scripts
20+
target_chains/ethereum/contracts
21+
target_chains/ethereum/abi_generator
22+
target_chains/ethereum/entropy_sdk/solidity
23+
target_chains/ethereum/sdk/js
24+
target_chains/ethereum/sdk/solidity
25+
target_chains/ethereum/sdk/stylus/pyth-mock-solidity
26+
target_chains/ethereum/examples/coin_flip/app
27+
target_chains/fuel/sdk/js
28+
target_chains/starknet/sdk/js
29+
target_chains/sui/sdk/js
30+
target_chains/sui/sdk/js-iota
31+
target_chains/sui/cli
32+
target_chains/sui/cli-iota
33+
target_chains/solana/sdk/js/solana_utils
34+
target_chains/solana/sdk/js/pyth_solana_receiver
35+
target_chains/ton/contracts
36+
target_chains/ton/sdk/js
37+
contract_manager
38+
lazer/contracts/solana
39+
lazer/sdk/js

governance/xc_admin/packages/xc_admin_frontend/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"pull:env": "[ $CI ] || VERCEL_ORG_ID=team_BKQrg3JJFLxZyTqpuYtIY0rj VERCEL_PROJECT_ID=prj_TCjesnm3pxM7Ay8oxlTH4xLkkmP9 vercel env pull",
1111
"start:dev": "next dev --port 3004",
1212
"start:prod": "next start --port 3004",
13+
"test:format": "prettier --check .",
14+
"fix:format": "prettier --write .",
1315
"test:lint": "next lint --max-warnings 0"
1416
},
1517
"dependencies": {

lazer/sdk/js/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
"fix:lint": "eslint --fix . --max-warnings 0",
2727
"test:lint": "eslint . --max-warnings 0",
2828
"test:types": "tsc",
29+
"test:format": "prettier --check .",
30+
"fix:format": "prettier --write .",
2931
"example": "node --loader ts-node/esm examples/index.js",
3032
"doc": "typedoc --out docs/typedoc src",
3133
"publish": "pnpm run script -- publish"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"devDependencies": {
2020
"lerna": "^8.1.8",
21-
"prettier": "2.7.1",
21+
"prettier": "^3.5.3",
2222
"turbo": "^2.2.3"
2323
},
2424
"pnpm": {

pnpm-lock.yaml

Lines changed: 162 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pythnet/message_buffer/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"version": "0.1.0",
44
"private": "true",
55
"scripts": {
6-
"init-buffer": "pnpm exec ts-node scripts/setup_message_buffer.ts"
6+
"init-buffer": "pnpm exec ts-node scripts/setup_message_buffer.ts",
7+
"test:format": "prettier --check .",
8+
"fix:format": "prettier --write ."
79
},
810
"dependencies": {
911
"@coral-xyz/anchor": "^0.27.0",

target_chains/aptos/cli/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"main": "index.js",
77
"scripts": {
88
"cli": "ts-node src/cli.ts",
9-
"build": "tsc"
9+
"build": "tsc",
10+
"test:format": "prettier --check .",
11+
"fix:format": "prettier --write ."
1012
},
1113
"author": "",
1214
"license": "ISC",

target_chains/cosmwasm/deploy-scripts/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"build": "tsc",
88
"build-contract": "ts-node ./src/build-contract.ts",
99
"instantiate-wormhole": "ts-node ./src/instantiate-wormhole.ts",
10-
"instantiate-pyth": "ts-node ./src/instantiate-pyth.ts"
10+
"instantiate-pyth": "ts-node ./src/instantiate-pyth.ts",
11+
"test:format": "prettier --check .",
12+
"fix:format": "prettier --write ."
1113
},
1214
"author": "",
1315
"license": "Apache-2.0",
@@ -25,6 +27,7 @@
2527
},
2628
"devDependencies": {
2729
"@types/adm-zip": "^0.5.0",
28-
"@types/yargs": "^17.0.18"
30+
"@types/yargs": "^17.0.18",
31+
"prettier": "^3.5.3"
2932
}
3033
}

target_chains/cosmwasm/tools/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"private": "true",
77
"scripts": {
88
"build": "tsc",
9-
"deploy": "ts-node ./src/ci/deploy.ts"
9+
"deploy": "ts-node ./src/ci/deploy.ts",
10+
"test:format": "prettier --check .",
11+
"fix:format": "prettier --write ."
1012
},
1113
"author": "",
1214
"license": "Apache-2.0",

0 commit comments

Comments
 (0)