Skip to content

Commit af50add

Browse files
authored
Revert ci changes (#292)
* Revert "Readd pre-commit hook (#290)" This reverts commit 43bd287. * Revert "Improve ci config (#287)" This reverts commit 87ba942.
1 parent 43bd287 commit af50add

34 files changed

+117
-341
lines changed

.envrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/workflows/js-checks.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: JS/TS checks
2+
on:
3+
pull_request:
4+
push:
5+
branches: [main]
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: 18
14+
cache: "npm"
15+
- name: Install deps
16+
run: npm ci
17+
- name: Lint
18+
run: npm run lint
19+
- name: Test
20+
run: npm run test
21+
- name: Build
22+
run: npm run build

.github/workflows/pre-commit.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Pre-commit checks
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
- uses: pre-commit/[email protected]

.github/workflows/test.yaml

Lines changed: 0 additions & 99 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ node_modules
99

1010
.DS_Store
1111
.env.local
12-
tsconfig.tsbuildinfo

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.pre-commit-config.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
repos:
2-
- repo: local
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.2.0
34
hooks:
4-
- id: check-prettier
5-
name: Check Prettier
6-
entry: npm run test:format --
7-
language: system
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-added-large-files
8+
args: ["--maxkb=3000"]
9+
exclude: package-lock.json
10+
# Hook to format many type of files in the repo
11+
# including solidity contracts.
12+
- repo: https://github.com/pre-commit/mirrors-prettier
13+
rev: "v2.7.1"
14+
hooks:
15+
- id: prettier
16+
additional_dependencies:
17+
18+

__tests__/validateCodeSnippets.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function wrapSolCode(code: string): string {
7272
async function runCodeSnippet(
7373
code: string,
7474
language: string,
75-
id: string,
75+
id: string
7676
): Promise<[boolean, string]> {
7777
if (language === "typescript") {
7878
const tempFilePath = join(codeSnippetsDir, `${id}.ts`);
@@ -94,7 +94,7 @@ async function runCodeSnippet(
9494
fs.writeFileSync(
9595
join(tempFilePath, "Cargo.toml"),
9696
generateCargoText(),
97-
"utf8",
97+
"utf8"
9898
);
9999
// cargo check checks syntax without doing a full build. It's faster (but still pretty slow)
100100
const command = `cd ${tempFilePath} && cargo check`;
@@ -132,7 +132,7 @@ path = "lib.rs"
132132
}
133133

134134
async function runValidationCommand(
135-
command: string,
135+
command: string
136136
): Promise<[boolean, string]> {
137137
try {
138138
const result = await execPromise(command);
@@ -143,21 +143,12 @@ async function runValidationCommand(
143143
}
144144
}
145145

146-
async function runValidationFunction(
147-
input: string,
148-
f: (arg: string) => void,
149-
): Promise<[boolean, string]> {
146+
async function runValidationFunction(input: string, f: (string) => void) {
150147
try {
151148
f(input);
152149
return [true, input];
153150
} catch (error) {
154-
if (typeof error === "string") {
155-
return [false, error];
156-
} else if (error instanceof Error) {
157-
return [false, error.toString()];
158-
} else {
159-
return [false, "unknown error"];
160-
}
151+
return [false, error.toString()];
161152
}
162153
}
163154

components/ContractInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const ContractInfo = () => {
2020
setIsLoading(true);
2121
setFee((await pythContract.getUpdateFee(["0x01"])).toString());
2222
setValidTimePeriod(
23-
(await pythContract.getValidTimePeriod()).toString(),
23+
(await pythContract.getValidTimePeriod()).toString()
2424
);
2525
setIsLoading(false);
2626
} catch (error: any) {

components/CosmWasmExecute.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const CosmWasmExecute = ({ buildMsg, feeKey }: CosmWasmExecuteProps) => {
8181

8282
if (msgJson === undefined || funds === undefined) {
8383
setResponsePreface(
84-
`Please populate all of the arguments with valid values.`,
84+
`Please populate all of the arguments with valid values.`
8585
);
8686
setResponse(undefined);
8787
} else {

0 commit comments

Comments
 (0)