Skip to content

Commit 9613544

Browse files
authored
feat(ci): linting (#84)
1 parent 9dfee2f commit 9613544

25 files changed

+80627
-1550
lines changed

.config/en_US.dic

Lines changed: 79579 additions & 0 deletions
Large diffs are not rendered by default.

.config/forest.dic

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
145
2+
+
3+
Algorand/M
4+
API/M
5+
APIs
6+
args
7+
arities
8+
arity
9+
async
10+
attoFIL
11+
benchmark/GD
12+
bitfield
13+
bitswap
14+
BLAKE2b
15+
blockchain/M
16+
blockstore/SM
17+
BLS
18+
butterflynet
19+
calibnet
20+
callee
21+
canonicalization
22+
CAR/SM
23+
CARv1/SM
24+
CARv2/SM
25+
CBOR
26+
CID/SM
27+
CIDs
28+
ChainSafe/M
29+
CLI
30+
CloudFlare
31+
clonable
32+
codebase
33+
codecov
34+
codec
35+
cron
36+
crypto
37+
CurrentEpoch
38+
daemon
39+
daemonize
40+
Datacap
41+
devnet
42+
DB/S
43+
deserialize/D
44+
destructuring
45+
DNS
46+
durations
47+
EIP
48+
EIP155
49+
enum
50+
Enum
51+
EOF
52+
Ethereum
53+
eth
54+
exa
55+
EVM
56+
F3
57+
FFI
58+
FIL
59+
Filecoin/M
60+
Filops
61+
FIP
62+
FVM
63+
GC
64+
GiB
65+
HAMT
66+
hasher
67+
healthcheck
68+
implementor/SM
69+
IPFS
70+
ip
71+
IPLD
72+
JSON
73+
JWT
74+
Kademlia
75+
Kubernetes
76+
Leptos
77+
libp2p
78+
liveness
79+
localhost
80+
mainnet
81+
MDNS
82+
mempool
83+
Merkle
84+
MiB
85+
middleware
86+
milliGas
87+
multiaddr/SM
88+
multihash
89+
multisig
90+
mutex
91+
Open
92+
OpenRPC
93+
overallocation
94+
P2P
95+
param/SM
96+
ParityDb
97+
ParityDB
98+
parsable
99+
performant
100+
PoC
101+
pointer/SM
102+
PoSt
103+
precommit
104+
R2
105+
reactivity
106+
RLP
107+
RPC
108+
schema/SM
109+
schemas
110+
SECP
111+
SECP256k1
112+
seekable
113+
serializable
114+
serializer/SM
115+
skippable
116+
statediff
117+
stateful
118+
stderr
119+
stdout
120+
struct/SM
121+
synchronizer
122+
syscall/S
123+
TCP
124+
testnet
125+
tipset/SM
126+
tipsetkey/S
127+
TOML
128+
trie
129+
truthy
130+
TTY
131+
uncompress
132+
unrepresentable
133+
untrusted
134+
URL
135+
UUID
136+
validator/S
137+
varint
138+
verifier
139+
verifreg
140+
VM/SM
141+
VRF
142+
WASM
143+
WebAssembly
144+
WebSocket
145+
WPoStProvingPeriodDeadlines
146+
zstd

.config/spellcheck.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
dev_comments = false
2+
skip_readme = false
3+
4+
[hunspell]
5+
lang = "en_US"
6+
search_dirs = ["."]
7+
skip_os_lookups = true
8+
use_builtin = true
9+
tokenization_splitchars = "\",;:.!?#(){}[]|/_-‒'`&@§¶…<>="
10+
extra_dictionaries = ["forest.dic", "en_US.dic"]
11+
12+
[hunspell.quirks]
13+
transform_regex = [
14+
# 10.7%
15+
"^[0-9_]+(?:\\.[0-9]*)?%$",
16+
]
17+
allow_concatenation = false
18+
allow_dashes = false
19+
allow_emojis = true
20+
21+
[nlprules]
22+
23+
[reflow]
24+
max_line_length = 80

.github/ISSUE_TEMPLATE/3-epic.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
name: Epic
3-
about: "[Internal] Larger chunk of work that can be broken down into smaller tasks"
3+
about:
4+
"[Internal] Larger chunk of work that can be broken down into smaller tasks"
45
title: ""
56
labels: "Type: Epic"
67
assignees: ""

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ Closes
2424
<!-- Follow this format https://keepachangelog.com/en/1.0.0/ -->
2525

2626
- [ ] I have performed a self-review of my own code,
27-
- [ ] I have made corresponding changes to the documentation. All new code adheres to the team's [documentation standards](https://github.com/ChainSafe/forest/wiki/Documentation-practices),
28-
- [ ] I have added tests that prove my fix is effective or that my feature works (if possible),
27+
- [ ] I have made corresponding changes to the documentation. All new code
28+
adheres to the team's
29+
[documentation standards](https://github.com/ChainSafe/forest/wiki/Documentation-practices),
30+
- [ ] I have added tests that prove my fix is effective or that my feature works
31+
(if possible),
2932

3033
<!-- Thank you 🔥 -->

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ updates:
1515
patterns:
1616
- "worker"
1717
- "worker-macros"
18+
leptos:
19+
patterns:
20+
- "leptos*"
1821
patch-versions:
1922
update-types:
2023
- "patch"

.github/workflows/deploy.yml

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,39 @@ jobs:
2626
runs-on: ubuntu-latest
2727

2828
steps:
29-
- name: Setup sccache
30-
uses: mozilla-actions/[email protected]
31-
timeout-minutes: "${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}"
32-
continue-on-error: true
33-
34-
- name: Checkout code
35-
uses: actions/checkout@v4
36-
37-
- name: Setup Rust
38-
uses: actions-rust-lang/setup-rust-toolchain@v1
39-
40-
- name: Install wasm-pack
41-
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
42-
43-
- uses: sigoden/install-binary@v1
44-
with:
45-
repo: WebAssembly/binaryen
46-
name: wasm-opt
47-
48-
- name: Install worker-build
49-
run: cargo install --locked worker-build
50-
51-
- name: Dry Run
52-
if: github.ref != 'refs/heads/main'
53-
uses: cloudflare/wrangler-action@v3
54-
with:
55-
command: deploy --dry-run
56-
57-
- name: Publish
58-
if: github.ref == 'refs/heads/main'
59-
uses: cloudflare/wrangler-action@v3
60-
with:
61-
apiToken: ${{ secrets.CF_API_TOKEN }}
29+
- name: Setup sccache
30+
uses: mozilla-actions/[email protected]
31+
timeout-minutes: "${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}"
32+
continue-on-error: true
33+
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Setup Rust
38+
uses: actions-rust-lang/setup-rust-toolchain@v1
39+
40+
- name: Install wasm-pack
41+
run:
42+
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
43+
44+
- uses: sigoden/install-binary@v1
45+
with:
46+
repo: WebAssembly/binaryen
47+
name: wasm-opt
48+
49+
- name: Install worker-build
50+
run: cargo install --locked worker-build
51+
52+
- run: corepack enable
53+
54+
- name: Dry Run
55+
if: github.ref != 'refs/heads/main'
56+
uses: cloudflare/wrangler-action@v3
57+
with:
58+
command: deploy --dry-run
59+
60+
- name: Publish
61+
if: github.ref == 'refs/heads/main'
62+
uses: cloudflare/wrangler-action@v3
63+
with:
64+
apiToken: ${{ secrets.CF_API_TOKEN }}

.github/workflows/lint.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Lint
2+
3+
concurrency:
4+
group: "${{ github.workflow }}-${{ github.ref }}"
5+
cancel-in-progress: "${{ github.ref != 'refs/heads/main' }}"
6+
7+
on:
8+
workflow_dispatch:
9+
merge_group:
10+
pull_request:
11+
branches:
12+
- main
13+
push:
14+
branches:
15+
- main
16+
17+
env:
18+
CACHE_TIMEOUT_MINUTES: 5
19+
SCCACHE_GHA_ENABLED: "true"
20+
RUSTC_WRAPPER: sccache
21+
CC: sccache clang
22+
CXX: sccache clang++
23+
24+
jobs:
25+
lint:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Setup sccache
30+
uses: mozilla-actions/[email protected]
31+
timeout-minutes: "${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}"
32+
continue-on-error: true
33+
- uses: actions/checkout@v4
34+
- name: Apt Dependencies
35+
uses: nick-fields/retry@v3
36+
with:
37+
timeout_minutes: 5
38+
max_attempts: 3
39+
command: |
40+
sudo apt-get install -y libclang-dev # required dep for cargo-spellcheck
41+
- run: make install-lint-tools-ci
42+
env:
43+
RUSTFLAGS: "-Cstrip=symbols"
44+
- run: make lint-all

.github/workflows/test.yml

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,45 +26,42 @@ jobs:
2626
runs-on: ubuntu-latest
2727

2828
steps:
29-
- name: Setup sccache
30-
uses: mozilla-actions/[email protected]
31-
timeout-minutes: "${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}"
32-
continue-on-error: true
29+
- name: Setup sccache
30+
uses: mozilla-actions/[email protected]
31+
timeout-minutes: "${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}"
32+
continue-on-error: true
3333

34-
- name: Checkout code
35-
uses: actions/checkout@v4
34+
- name: Checkout code
35+
uses: actions/checkout@v4
3636

37-
- name: Setup Rust
38-
uses: actions-rust-lang/setup-rust-toolchain@v1
37+
- name: Setup Rust
38+
uses: actions-rust-lang/setup-rust-toolchain@v1
3939

40-
- run: cargo fmt --check
40+
- name: Install wasm-pack
41+
run:
42+
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
4143

42-
- run: cargo clippy --all-features --all-targets -- --deny warnings
44+
- uses: sigoden/install-binary@v1
45+
with:
46+
repo: WebAssembly/binaryen
47+
name: wasm-opt
4348

44-
- name: Install wasm-pack
45-
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
49+
- name: Install worker-build
50+
run: cargo install --locked worker-build
4651

47-
- uses: sigoden/install-binary@v1
48-
with:
49-
repo: WebAssembly/binaryen
50-
name: wasm-opt
52+
- uses: nanasess/setup-chromedriver@v2
53+
- run: |
54+
chromedriver --port=9515 &
5155
52-
- name: Install worker-build
53-
run: cargo install --locked worker-build
56+
- name: Run website
57+
run: |
58+
npx wrangler@latest build
59+
npx wrangler@latest dev &
60+
echo "waiting"
61+
timeout 120 sh -c 'until nc -z $0 $1; do sleep 1; done' 127.0.0.1 8787
5462
55-
- uses: nanasess/setup-chromedriver@v2
56-
- run: |
57-
chromedriver --port=9515 &
58-
59-
- name: Run website
60-
run: |
61-
npx wrangler@latest build
62-
npx wrangler@latest dev &
63-
echo "waiting"
64-
timeout 120 sh -c 'until nc -z $0 $1; do sleep 1; done' 127.0.0.1 8787
65-
66-
- name: E2E
67-
run: |
68-
cd e2e
69-
cargo build
70-
cargo run
63+
- name: E2E
64+
run: |
65+
cd e2e
66+
cargo build
67+
cargo run

0 commit comments

Comments
 (0)