Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use julia-format action #123

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 6 additions & 34 deletions .github/workflows/Format-check.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,11 @@
name: format

name: Format suggestions
on:
push:
branches:
- 'main'
- 'release-'
tags: '*'
pull_request:
pull_request

jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ['1']
julia-arch: [x64]
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
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version="1.0.45"))'
julia -e 'using JuliaFormatter; format(["src", "test", "examples", "docs"], 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 src/DispersiveShallowWater.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using TimerOutputs: TimerOutputs, print_timer, reset_timer!
@reexport using TrixiBase: trixi_include
using TrixiBase: TrixiBase, @trixi_timeit, timer

include("boundary_conditions.jl")
include("boundary_conditions.jl")
JoshuaLampert marked this conversation as resolved.
Show resolved Hide resolved
include("mesh.jl")
include("equations/equations.jl")
include("solver.jl")
Expand Down
Loading