Skip to content

Commit eff836c

Browse files
committed
draft autoformat bot
1 parent c001dab commit eff836c

File tree

3 files changed

+535
-0
lines changed

3 files changed

+535
-0
lines changed

.github/workflows/prformatter.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PR Formatter
2+
env:
3+
JULIA_NUM_THREADS: 2
4+
on:
5+
pull_request:
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
with:
16+
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
17+
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
18+
- name: Setup Python
19+
uses: actions/setup-python@v3
20+
- name: Run pre-commit
21+
uses: pre-commit/[email protected]
22+
- name: Commit files
23+
run: |
24+
git config --local user.email "[email protected]"
25+
git config --local user.name "PR Pre-Commit Bot"
26+
git commit -m "add bot commits" -a
27+
- name: Push changes
28+
uses: ad-m/[email protected]
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
branch: ${{ github.ref }}

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repos:
2+
- repo: "https://github.com/domluna/JuliaFormatter.jl"
3+
rev: "v1.0.62"
4+
hooks:
5+
- id: "julia-formatter"

0 commit comments

Comments
 (0)