-
-
Notifications
You must be signed in to change notification settings - Fork 111
40 lines (35 loc) · 880 Bytes
/
check_format.yml
File metadata and controls
40 lines (35 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
name: check_format
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
check_format:
name: Check format
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@v1
with:
version: 1.9
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install JuliaFormatter
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
- name: Format code
run: |
git clean -f -x -d
julia -e 'using JuliaFormatter; format(".", verbose=true)'
- name: Fail if needs reformatting
run: |
if [[ $(git status --porcelain) ]]; then
echo "please reformat these files:"
git status --porcelain=v1
exit 1
fi
...