-
Notifications
You must be signed in to change notification settings - Fork 50
42 lines (42 loc) · 1.25 KB
/
style.yml
File metadata and controls
42 lines (42 loc) · 1.25 KB
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
41
42
name: Style-Enforcer
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- 'main'
tags:
- '*'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- 'README.md'
- '.gitignore'
jobs:
format-check:
name: Julia
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: "1"
- uses: julia-actions/cache@v2
- name: Install JuliaFormatter
shell: julia --project=@format --color=yes {0}
run: |
using Pkg
Pkg.add(PackageSpec(; name="JuliaFormatter", version="1"))
- name: Check formatting
shell: julia --project=@format --color=yes {0}
run: |
using JuliaFormatter
paths = ["docs", "src"]
isdir("ext") && push!(paths, "ext")
format(paths; verbose=true) || exit(1)
# Add formatting suggestions to non-draft PRs when "Check formatting" fails
- uses: reviewdog/action-suggester@v1
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.draft == false }}
with:
tool_name: JuliaFormatter