Skip to content

Commit a2c2a04

Browse files
committed
chore: add prettier/typo check to CI
1 parent a6c1e9c commit a2c2a04

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

.github/typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[default.extend-words]
2+
muc = "muc" # For Munich location code

.github/workflows/ci.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ concurrency:
88
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
99
jobs:
1010
validate-readme-files:
11+
name: Validate README files
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Check out code
@@ -21,6 +22,7 @@ jobs:
2122
- name: Remove build file artifact
2223
run: rm ./contributors
2324
test-terraform:
25+
name: Validate Terraform output
2426
runs-on: ubuntu-latest
2527
steps:
2628
- name: Check out code
@@ -40,3 +42,23 @@ jobs:
4042
run: bun install
4143
- name: Run tests
4244
run: bun test
45+
validate-style:
46+
name: Check for typos and unformatted code
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Check out code
50+
uses: actions/checkout@v4
51+
- name: Install Bun
52+
uses: oven-sh/setup-bun@v2
53+
with:
54+
bun-version: latest
55+
- name: Install dependencies
56+
run: bun install
57+
- name: Validate formatting
58+
run: bun fmt:ci
59+
- name: Check for typos
60+
uses: crate-ci/[email protected]
61+
with:
62+
config: .github/typos.toml
63+
- name: Lint
64+
run: bun lint

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "modules",
33
"scripts": {
44
"test": "bun test",
5-
"fmt": "bun x prettier -w **/*.sh .sample/run.sh new.sh **/*.ts **/*.md *.md && terraform fmt **/*.tf .sample/main.tf",
6-
"fmt:ci": "bun x prettier --check **/*.sh .sample/run.sh new.sh **/*.ts **/*.md *.md && terraform fmt -check **/*.tf .sample/main.tf",
5+
"fmt": "bun x prettier --write **/*.sh **/*.ts **/*.md *.md && terraform fmt **/*.tf",
6+
"fmt:ci": "bun x prettier --check **/*.sh **/*.ts **/*.md *.md && terraform fmt -check **/*.tf",
77
"update-version": "./update-version.sh"
88
},
99
"devDependencies": {

0 commit comments

Comments
 (0)