Skip to content

Commit 6f05879

Browse files
authored
[CI] Add formatters to pre-commit (#48)
1 parent 78c5e97 commit 6f05879

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/format.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Format
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths-ignore:
7+
- '**.md'
8+
- 'public/**'
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
format:
15+
runs-on: ubuntu-22.04
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: "3.11"
25+
26+
- name: Set up Node
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: "22"
30+
31+
- name: Install formatters
32+
run: pip install black
33+
34+
- name: Run formatters
35+
run: |
36+
black .
37+
npx --yes prettier@3 '**/*.{js,mjs}' --ignore-path .gitignore --write
38+
git --no-pager diff --patch --exit-code

0 commit comments

Comments
 (0)