Skip to content

Commit 3f1e013

Browse files
gdallepenelopeysm
andauthored
Add pre-commit workflow for formatting (#320)
* Add pre-commit workflow for formatting * Install JuliaFormatter properly * Add General * Add path * Update .pre-commit-config.yaml Co-authored-by: Penelope Yong <penelopeysm@gmail.com> * Update .pre-commit-config.yaml Co-authored-by: Penelope Yong <penelopeysm@gmail.com> --------- Co-authored-by: Penelope Yong <penelopeysm@gmail.com>
1 parent d318be5 commit 3f1e013

3 files changed

Lines changed: 22 additions & 12 deletions

File tree

.github/workflows/Format.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/PreCommit.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v3
14+
- uses: julia-actions/setup-julia@v3
15+
- uses: julia-actions/cache@v3
16+
- run: julia -e 'using Pkg; Pkg.Registry.add("General"); Pkg.Apps.add("JuliaFormatter")'
17+
- uses: pre-commit/action@v3.0.1

.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/JuliaEditorSupport/JuliaFormatter.jl
3+
rev: 0935890389c9fbc45f4ee150064c0abe5340b6a9 # v2.4.0
4+
hooks:
5+
- id: "jlfmt"

0 commit comments

Comments
 (0)