Skip to content

Commit

Permalink
Fix formatter to old version (#56)
Browse files Browse the repository at this point in the history
* Fix formatter to old version

* Update FormatCheck.yml

* run old version of formatter
  • Loading branch information
ranocha authored Aug 19, 2024
1 parent 56e07b2 commit 3e88cc8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 39 deletions.
39 changes: 5 additions & 34 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,12 @@
name: format-check
name: Format suggestions

on:
push:
branches:
- 'main'
tags: '*'
pull_request:

jobs:
format_check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1]
julia-arch: [x86]
os: [ubuntu-latest]
code-style:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
- uses: julia-actions/julia-format@v3
with:
version: ${{ matrix.julia-version }}

- uses: actions/checkout@v4
- name: Install JuliaFormatter and format
# This will use the latest version by default but you can set the version like so:
#
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
julia -e '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'
version: '1.0.45' # default: '1'
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ makedocs(
"Reference" => "reference.md",
"VTKBase.jl" => vtkbase_docs,
"Contributing" => "contributing.md",
"License" => "license.md"
"License" => "license.md",
])

deploydocs(repo = "github.com/JuliaVTK/ReadVTK.jl",
Expand Down
8 changes: 4 additions & 4 deletions test/pvtk_files.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extents = [
(1:10, 1:5, 1:4), # process 1
(10:15, 1:5, 1:4), # process 2
(1:10, 5:12, 1:4), # process 3
(10:15, 5:12, 1:4) # process 4
(10:15, 5:12, 1:4), # process 4
]

saved_files = Vector{Vector{String}}(undef, 4) # files saved by each "process"
Expand Down Expand Up @@ -102,14 +102,14 @@ all_data = [
(points = rand(3, 5), # 5 points on process 1
cells = [ # 2 cells on process 1
MeshCell(VTKCellTypes.VTK_TRIANGLE, [1, 4, 2]),
MeshCell(VTKCellTypes.VTK_QUAD, [2, 4, 3, 5])
MeshCell(VTKCellTypes.VTK_QUAD, [2, 4, 3, 5]),
]),

# Process 2
(points = rand(3, 4), # 4 points on process 2
cells = [ # 1 cell on process 2
MeshCell(VTKCellTypes.VTK_QUAD, [1, 2, 3, 4])
])
MeshCell(VTKCellTypes.VTK_QUAD, [1, 2, 3, 4]),
]),
]

saved_files = Vector{Vector{String}}(undef, 2) # files saved by each "process"
Expand Down

0 comments on commit 3e88cc8

Please sign in to comment.