Skip to content

Commit

Permalink
add formatter action
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Aug 3, 2022
1 parent 7407069 commit d7015a8
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
style = "sciml"
annotate_untyped_fields_with_any = false
separate_kwargs_with_semicolon = true
whitespace_typedefs = false
trailing_comma = "nothing"
align_struct_field = true
align_conditional = true
align_assignment = true
align_pair_arrow = true
12 changes: 6 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
sudo apt-get install mpich libhdf5-mpich-dev
echo "JULIA_HDF5_PATH=/usr/lib/x86_64-linux-gnu/hdf5/mpich/" >> $GITHUB_ENV
echo "JULIA_MPI_BINARY=system" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
- version: '1.3'
os: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
Expand All @@ -78,7 +78,7 @@ jobs:
env:
JULIA_DEBUG: Main
- uses: julia-actions/julia-processcoverage@latest
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info

Expand All @@ -99,14 +99,14 @@ jobs:
- {user: JuliaIO, repo: MAT.jl}
- {user: JuliaIO, repo: JLD.jl}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- name: Clone ${{ matrix.package.repo }}
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
path: downstream
Expand All @@ -131,7 +131,7 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-docdeploy@latest
env:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/Format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: format

on:
push:
branches:
- 'master'
- 'release-'
tags: '*'
pull_request:

jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ['1']
julia-arch: [x64]
os: [ubuntu-latest]
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}

- uses: actions/checkout@v3
- 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 "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end'

0 comments on commit d7015a8

Please sign in to comment.