use julia-code-style-suggesters
This commit is contained in:
parent
24e0945ed1
commit
bc6f2937bc
34
.github/workflows/format_check.yml
vendored
34
.github/workflows/format_check.yml
vendored
@ -1,37 +1,15 @@
|
|||||||
name: format
|
name: format
|
||||||
|
|
||||||
|
name: Code style
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
tags: '*'
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
code-style:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
julia-version: ['1']
|
|
||||||
julia-arch: [x64]
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: julia-actions/setup-julia@latest
|
- uses: tkf/julia-code-style-suggesters@v1
|
||||||
with:
|
|
||||||
version: ${{ matrix.julia-version }}
|
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Install JuliaFormatter and format
|
|
||||||
run: |
|
|
||||||
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
|
|
||||||
julia -e 'using JuliaFormatter; format(["src", "test"], verbose=true)'
|
|
||||||
- name: Format check
|
|
||||||
run: |
|
|
||||||
julia -e '
|
|
||||||
out = Cmd(`git diff --name-only`) |> read |> String
|
|
||||||
if out == ""
|
|
||||||
exit(0)
|
|
||||||
else
|
|
||||||
@error "These files have not been formatted:\n$out"
|
|
||||||
exit(1)
|
|
||||||
end'
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user