From f3d86c903a3ba36c9ac35615e82b0bc94488eccd Mon Sep 17 00:00:00 2001 From: huiyuxie Date: Thu, 17 Oct 2024 11:52:56 -1000 Subject: [PATCH 1/8] Start --- .github/workflows/FormatCheck.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index 26006b9555..98989e46d2 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -1,4 +1,4 @@ -name: format-check +name: Format check and suggestions on: push: @@ -6,6 +6,8 @@ on: - 'main' tags: '*' pull_request: + # this argument is not required if you don't use the `suggestion-label` input + types: [opened, reopened, synchronize, labeled, unlabeled] jobs: check-format: @@ -26,11 +28,9 @@ jobs: # # julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version = "0.13.0"))' # - # TODO: Change the call below to - # format(".") run: | julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version="1.0.60"))' - julia -e 'using JuliaFormatter; format(["benchmark", "examples", "ext", "src", "test", "utils"])' + julia -e 'using JuliaFormatter; format(".")' - name: Format check run: | julia -e ' @@ -42,3 +42,12 @@ jobs: write(stdout, out) exit(1) end' + + format-suggestions: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/julia-format@v3 + with: + version: "1" # Set this to '1.0.54' if needed + suggestion-label: "format-suggest" # Leave empty to show suggestions for all PRs From 8c8523c590746e3f430556030aa94fd341fed7bb Mon Sep 17 00:00:00 2001 From: Huiyu Xie Date: Thu, 17 Oct 2024 18:52:41 -1000 Subject: [PATCH 2/8] Update .github/workflows/FormatCheck.yml Co-authored-by: Hendrik Ranocha --- .github/workflows/FormatCheck.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index 98989e46d2..32c6da28b0 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -6,8 +6,6 @@ on: - 'main' tags: '*' pull_request: - # this argument is not required if you don't use the `suggestion-label` input - types: [opened, reopened, synchronize, labeled, unlabeled] jobs: check-format: From a0af29b553e69195b9e65619cb7fa00caba0a5ec Mon Sep 17 00:00:00 2001 From: Huiyu Xie Date: Thu, 17 Oct 2024 18:52:52 -1000 Subject: [PATCH 3/8] Update .github/workflows/FormatCheck.yml Co-authored-by: Hendrik Ranocha --- .github/workflows/FormatCheck.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index 32c6da28b0..2bb66b11f5 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -48,4 +48,3 @@ jobs: - uses: julia-actions/julia-format@v3 with: version: "1" # Set this to '1.0.54' if needed - suggestion-label: "format-suggest" # Leave empty to show suggestions for all PRs From e790ff0605dcbeaa3e157054e67ac724cc82e39a Mon Sep 17 00:00:00 2001 From: Huiyu Xie Date: Thu, 17 Oct 2024 18:58:26 -1000 Subject: [PATCH 4/8] Update .github/workflows/FormatCheck.yml Co-authored-by: Hendrik Ranocha --- .github/workflows/FormatCheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index 2bb66b11f5..fd47ff4cd6 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -47,4 +47,4 @@ jobs: - uses: actions/checkout@v4 - uses: julia-actions/julia-format@v3 with: - version: "1" # Set this to '1.0.54' if needed + version: "1.0.60" From c4c5dd5c57bf473d419d1b68181377a3bba1b39b Mon Sep 17 00:00:00 2001 From: huiyuxie Date: Thu, 17 Oct 2024 19:00:57 -1000 Subject: [PATCH 5/8] Fix --- .github/workflows/FormatCheck.yml | 35 +------------------------------ 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index fd47ff4cd6..7d014cab2c 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -1,4 +1,4 @@ -name: Format check and suggestions +name: Format suggestions on: push: @@ -8,39 +8,6 @@ on: pull_request: jobs: - check-format: - runs-on: ${{ matrix.os }} - strategy: - matrix: - julia-version: [1] - julia-arch: [x86] - os: [ubuntu-latest] - steps: - - uses: julia-actions/setup-julia@latest - 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", version="1.0.60"))' - julia -e 'using JuliaFormatter; format(".")' - - 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' - format-suggestions: runs-on: ubuntu-latest steps: From 311b6243cb436fb8df778f9c4ef217c7d224573e Mon Sep 17 00:00:00 2001 From: Huiyu Xie Date: Thu, 17 Oct 2024 20:46:02 -1000 Subject: [PATCH 6/8] Sample --- examples/tree_1d_dgsem/elixir_advection_basic.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/tree_1d_dgsem/elixir_advection_basic.jl b/examples/tree_1d_dgsem/elixir_advection_basic.jl index cba522f636..480e388c85 100644 --- a/examples/tree_1d_dgsem/elixir_advection_basic.jl +++ b/examples/tree_1d_dgsem/elixir_advection_basic.jl @@ -2,6 +2,9 @@ using OrdinaryDiffEq using Trixi + + + ############################################################################### # semidiscretization of the linear advection equation @@ -44,8 +47,7 @@ save_solution = SaveSolutionCallback(interval = 100, stepsize_callback = StepsizeCallback(cfl = 1.6) # Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver -callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, - stepsize_callback) +callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, stepsize_callback) ############################################################################### # run the simulation From c926bf03a719ec52510fc31fa8a2a809737f53d4 Mon Sep 17 00:00:00 2001 From: huiyuxie Date: Fri, 18 Oct 2024 10:59:22 -1000 Subject: [PATCH 7/8] Revert --- .github/workflows/FormatCheck.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index 26006b9555..98989e46d2 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -1,4 +1,4 @@ -name: format-check +name: Format check and suggestions on: push: @@ -6,6 +6,8 @@ on: - 'main' tags: '*' pull_request: + # this argument is not required if you don't use the `suggestion-label` input + types: [opened, reopened, synchronize, labeled, unlabeled] jobs: check-format: @@ -26,11 +28,9 @@ jobs: # # julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version = "0.13.0"))' # - # TODO: Change the call below to - # format(".") run: | julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version="1.0.60"))' - julia -e 'using JuliaFormatter; format(["benchmark", "examples", "ext", "src", "test", "utils"])' + julia -e 'using JuliaFormatter; format(".")' - name: Format check run: | julia -e ' @@ -42,3 +42,12 @@ jobs: write(stdout, out) exit(1) end' + + format-suggestions: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/julia-format@v3 + with: + version: "1" # Set this to '1.0.54' if needed + suggestion-label: "format-suggest" # Leave empty to show suggestions for all PRs From 783e9c0926d6a45e8e34fa297c19ba2e8b45b357 Mon Sep 17 00:00:00 2001 From: huiyuxie Date: Fri, 18 Oct 2024 11:04:41 -1000 Subject: [PATCH 8/8] Revert --- examples/tree_1d_dgsem/elixir_advection_basic.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/tree_1d_dgsem/elixir_advection_basic.jl b/examples/tree_1d_dgsem/elixir_advection_basic.jl index 480e388c85..cba522f636 100644 --- a/examples/tree_1d_dgsem/elixir_advection_basic.jl +++ b/examples/tree_1d_dgsem/elixir_advection_basic.jl @@ -2,9 +2,6 @@ using OrdinaryDiffEq using Trixi - - - ############################################################################### # semidiscretization of the linear advection equation @@ -47,7 +44,8 @@ save_solution = SaveSolutionCallback(interval = 100, stepsize_callback = StepsizeCallback(cfl = 1.6) # Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver -callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, stepsize_callback) +callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, + stepsize_callback) ############################################################################### # run the simulation