Skip to content

Commit bcff765

Browse files
author
dtfiedler
committed
chore(deps): add husky and luacheck on build
1 parent 794da1b commit bcff765

File tree

4 files changed

+380
-3
lines changed

4 files changed

+380
-3
lines changed

.github/workflows/ant.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ jobs:
2929
with:
3030
token: ${{ secrets.CODECOV_TOKEN }}
3131

32+
lint:
33+
runs-on: ubuntu-24.04
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: leafo/gh-actions-lua@v10
37+
with:
38+
luaVersion: '5.3'
39+
- run: luacheck .
40+
3241
# TODO: add ar-io-sdk e2e tests against lua code to be bundled on changes (e.g. create a new ant, publish it and validate it works with the sdk)
3342

3443
integration:

.husky/pre-commit

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env sh
2+
3+
yarn lint-staged

package.json

+14-1
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,30 @@
55
"module:publish": "cd src && ao publish process.wasm -w ../tools/key.mjson --tag=\"Memory-Limit\" --value=\"1-gb\" --tag=\"Compute-Limit\" --value=\"9000000000000\" && cd ..",
66
"module:load": "node tools/load-module.mjs",
77
"module:spawn": "node tools/spawn-module.mjs",
8+
"lint": "luacheck .",
89
"aos:build": "node tools/bundle-aos.mjs",
910
"aos:publish": "node tools/bundle-aos.mjs && node tools/publish-aos.mjs",
1011
"aos:load": "node tools/bundle-aos.mjs && node tools/load-aos.mjs",
1112
"aos:spawn": "node tools/spawn-aos.mjs",
12-
"test": "yarn aos:build && node --test --test-concurrency 1 --experimental-wasm-memory64 **/*.test.mjs"
13+
"test": "yarn aos:build && node --test --test-concurrency 1 --experimental-wasm-memory64 **/*.test.mjs",
14+
"prepare": "husky"
1315
},
1416
"devDependencies": {
1517
"@ardrive/turbo-sdk": "^1.19.0",
1618
"@permaweb/ao-loader": "^0.0.35",
1719
"@permaweb/aoconnect": "^0.0.55",
1820
"arweave": "^1.15.1",
21+
"husky": "^9.1.6",
22+
"lint-staged": "^15.2.10",
1923
"prettier": "^3.3.2"
24+
},
25+
"lint-staged": {
26+
"*.lua": [
27+
"stylua",
28+
"luacheck --config .luacheckrc"
29+
],
30+
"*.{js,mjs}": [
31+
"prettier --write"
32+
]
2033
}
2134
}

0 commit comments

Comments
 (0)