-
-
Notifications
You must be signed in to change notification settings - Fork 7
36 lines (31 loc) · 920 Bytes
/
Format.yml
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
name: Format
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
docs:
name: CheckFormatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- shell: julia --project=format --color=yes {0}
run: |
using Pkg
Pkg.instantiate()
- shell: julia --project=format --color=yes {0}
run: |
using FormatJDS:
project_has_trailing_whitespace,
remove_trailing_whitespace
exitcode = project_has_trailing_whitespace() ? 1 : 0
println(exitcode == 1 ? "Trailing whitespace found" : "No trailing whitespace found")
if exitcode == 1
# Show where the trailing whitespace occurs.
remove_trailing_whitespace()
run(`git config --global color.diff true`)
run(`git diff`)
end
exit(exitcode)