Skip to content

Commit cb4193b

Browse files
committed
draft autoformat bot
1 parent c001dab commit cb4193b

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/prprecommit.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: PR Pre-Commit Bot
2+
env:
3+
JULIA_NUM_THREADS: 2
4+
on:
5+
pull_request:
6+
branches: ["master", "main"]
7+
jobs:
8+
pre-commit:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
ref: ${{ github.head_ref }}
15+
- name: Setup Julia
16+
uses: julia-actions/setup-julia@v2
17+
with:
18+
version: '1'
19+
- name: Setup JuliaFormatter
20+
run: |
21+
julia -e '
22+
using Pkg
23+
Pkg.add(name="JuliaFormatter", version="1.0.62")'
24+
- name: Setup Python
25+
uses: actions/setup-python@v3
26+
- name: Run pre-commit
27+
uses: pre-commit/[email protected]
28+
continue-on-error: true
29+
- name: Potentially commit changes
30+
uses: stefanzweifel/git-auto-commit-action@v5
31+
with:
32+
commit_message: linter bot commit -- feel free to overwrite

.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)