Skip to content

add format check action - initial repo format #20

add format check action - initial repo format

add format check action - initial repo format #20

Workflow file for this run

name: JuliaFormatter
on:
pull_request:
push:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
with:
version: '1'
- uses: actions/checkout@v3
- name: Install JuliaFormatter and format
shell: julia --project=@. --color=yes {0}
run: |
using Pkg
Pkg.activate(; temp=true)
Pkg.add("JuliaFormatter")
using JuliaFormatter
format(".", verbose=true)
- name: Format check
run: |
julia -e '
out = Cmd(`git diff --name-only`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end
'