Skip to content

Commit 2328b75

Browse files
authored
chore(ci): Add typos and license check workflows (#24)
1 parent 7151ce9 commit 2328b75

3 files changed

Lines changed: 126 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: License Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize, ready_for_review]
6+
paths:
7+
- "apps/**"
8+
- "sdk/**"
9+
- "dapps/**"
10+
- "packages/**"
11+
- "build-scripts/**"
12+
- ".eslintrc.js"
13+
- "linting/**"
14+
- "package.json"
15+
- "pnpm-lock.yaml"
16+
push:
17+
branches: [develop]
18+
19+
concurrency:
20+
group: license-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
22+
23+
jobs:
24+
license-check:
25+
name: license-check
26+
runs-on: ubuntu-latest
27+
if: (github.event.pull_request.draft == false || contains(github.event.pull_request.body, '[run-ci]'))
28+
steps:
29+
- name: Checkout code repository
30+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
31+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
32+
- name: Install Nodejs
33+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
34+
with:
35+
node-version: "24"
36+
cache: "pnpm"
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile
39+
- name: Run license check
40+
run: pnpm run eslint:check

.github/workflows/typos.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Typos
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize, ready_for_review]
6+
push:
7+
branches: [develop]
8+
9+
concurrency:
10+
group: typos-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
12+
13+
jobs:
14+
run:
15+
name: Spell Check with Typos
16+
runs-on: ubuntu-latest
17+
if: (github.event.pull_request.draft == false || contains(github.event.pull_request.body, '[run-ci]'))
18+
steps:
19+
- name: Checkout Actions Repository
20+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
21+
22+
- name: Check spelling
23+
uses: crate-ci/typos@945d407a5fc9097f020969446a16f581612ab4df # v1.24.5
24+
with:
25+
config: ./.typos.toml

.typos.toml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[default]
2+
extend-ignore-identifiers-re = [
3+
# Short git hashes
4+
"^[a-f0-9]{7}$",
5+
"^[a-f0-9]{12}$",
6+
# Base64
7+
"^[a-zA-Z0-9_]{30}$",
8+
"^[a-zA-Z0-9_]{43}$",
9+
"^[a-zA-Z0-9_]{44}$",
10+
"^[a-zA-Z0-9_]{47}$",
11+
"^[a-zA-Z0-9_]{49}$",
12+
"^[a-zA-Z0-9_]{50}$",
13+
"^[a-zA-Z0-9_]{56,}$",
14+
]
15+
16+
extend-ignore-re = [
17+
# Truncated hex IDs (ex. "0x9...a9b")
18+
"0x[a-f0-9]\\.{3}[a-f0-9]{3}",
19+
# Block ignore for docs (e.g. { /* spellchecker:off */ } ... { /* spellchecker:on */ })
20+
# This can be expanded to other comment styles if needed
21+
"(?s)(\\{ /\\*)\\s*spellchecker:off.*?\\n\\s*(\\{ /\\*)\\s*spellchecker:on",
22+
# BCS octet documentation
23+
"[0-9]{2}OCTECT",
24+
]
25+
26+
[type.css]
27+
extend-glob = ["*.css"]
28+
extend-words = { wdth = "wdth" }
29+
30+
[default.extend-words]
31+
# ordinal numbers (2nd, ...)
32+
nd = "nd"
33+
# random identifiers, variables, functions, ...
34+
tto = "tto"
35+
ser = "ser"
36+
groth = "groth"
37+
typ = "typ"
38+
cpy = "cpy"
39+
# Identity
40+
AAS = "AAS"
41+
# actual typos purposely used in tests
42+
assing = "assing"
43+
tring = "tring"
44+
# better suggestions for typos
45+
transferer = "transferrer"
46+
# not in the correction dictionary
47+
checkpoitn = "checkpoint"
48+
# crates
49+
bimap = "bimap"
50+
# plurals
51+
pendings = "pendings"
52+
53+
[default.extend-identifiers]
54+
numer = "numer"
55+
56+
[files]
57+
extend-exclude = [
58+
"pnpm-lock.yaml",
59+
"*.patch",
60+
"*.svg",
61+
]

0 commit comments

Comments
 (0)