From a7e2d739003b97b6f587b875dad43f4aeeb7a580 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Tue, 26 May 2026 09:03:48 +0200 Subject: [PATCH 1/6] Add pre-commit workflow for formatting --- .github/workflows/Format.yml | 12 ------------ .github/workflows/PreCommit.yml | 14 ++++++++++++++ .pre-commit-config.yaml | 5 +++++ 3 files changed, 19 insertions(+), 12 deletions(-) delete mode 100644 .github/workflows/Format.yml create mode 100644 .github/workflows/PreCommit.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/Format.yml b/.github/workflows/Format.yml deleted file mode 100644 index dd2b2c50..00000000 --- a/.github/workflows/Format.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Format suggestions -on: - pull_request: - # this argument is not required if you don't use the `suggestion-label` input - types: [opened, reopened, synchronize, labeled, unlabeled] -jobs: - code-style: - runs-on: ubuntu-latest - steps: - - uses: julia-actions/julia-format@v4 - with: - version: '1' # Set `version` to '1.0.54' if you need to use JuliaFormatter.jl v1.0.54 (default: '1') diff --git a/.github/workflows/PreCommit.yml b/.github/workflows/PreCommit.yml new file mode 100644 index 00000000..524f04fe --- /dev/null +++ b/.github/workflows/PreCommit.yml @@ -0,0 +1,14 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..9e837f6d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: +- repo: https://github.com/JuliaEditorSupport/JuliaFormatter.jl + rev: 3b196afa4a8ed92ba816edec6d122145e311ae35 # This PR. + hooks: + - id: "jlfmt" \ No newline at end of file From 58ac765e08a16c91d2d5648263cf666a37c76f68 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Tue, 26 May 2026 09:09:06 +0200 Subject: [PATCH 2/6] Install JuliaFormatter properly --- .github/workflows/PreCommit.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/PreCommit.yml b/.github/workflows/PreCommit.yml index 524f04fe..5be6d22a 100644 --- a/.github/workflows/PreCommit.yml +++ b/.github/workflows/PreCommit.yml @@ -11,4 +11,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 + - uses: julia-actions/setup-julia@v3 + - uses: julia-actions/cache@v3 + - run: julia -e 'using Pkg; Pkg.Apps.add(; url="https://github.com/JuliaEditorSupport/JuliaFormatter.jl", rev="3b196afa4a8ed92ba816edec6d122145e311ae35")' - uses: pre-commit/action@v3.0.1 From 354728087e0cb52eed3c8772ed645e40cab6dd36 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Tue, 26 May 2026 09:10:15 +0200 Subject: [PATCH 3/6] Add General --- .github/workflows/PreCommit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PreCommit.yml b/.github/workflows/PreCommit.yml index 5be6d22a..01dd49f9 100644 --- a/.github/workflows/PreCommit.yml +++ b/.github/workflows/PreCommit.yml @@ -13,5 +13,5 @@ jobs: - uses: actions/setup-python@v3 - uses: julia-actions/setup-julia@v3 - uses: julia-actions/cache@v3 - - run: julia -e 'using Pkg; Pkg.Apps.add(; url="https://github.com/JuliaEditorSupport/JuliaFormatter.jl", rev="3b196afa4a8ed92ba816edec6d122145e311ae35")' + - run: julia -e 'using Pkg; Pkg.Registry.add("General"); Pkg.Apps.add(; url="https://github.com/JuliaEditorSupport/JuliaFormatter.jl", rev="3b196afa4a8ed92ba816edec6d122145e311ae35")' - uses: pre-commit/action@v3.0.1 From bbdb3f0122992c63aa962ca9c211d7b1943b31ca Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Tue, 26 May 2026 09:17:07 +0200 Subject: [PATCH 4/6] Add path --- .github/workflows/PreCommit.yml | 2 +- .pre-commit-config.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PreCommit.yml b/.github/workflows/PreCommit.yml index 01dd49f9..1dc47d65 100644 --- a/.github/workflows/PreCommit.yml +++ b/.github/workflows/PreCommit.yml @@ -13,5 +13,5 @@ jobs: - uses: actions/setup-python@v3 - uses: julia-actions/setup-julia@v3 - uses: julia-actions/cache@v3 - - run: julia -e 'using Pkg; Pkg.Registry.add("General"); Pkg.Apps.add(; url="https://github.com/JuliaEditorSupport/JuliaFormatter.jl", rev="3b196afa4a8ed92ba816edec6d122145e311ae35")' + - run: julia -e 'using Pkg; Pkg.Registry.add("General"); Pkg.Apps.add("JuliaFormatter")' - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9e837f6d..e366868d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,4 +2,5 @@ repos: - repo: https://github.com/JuliaEditorSupport/JuliaFormatter.jl rev: 3b196afa4a8ed92ba816edec6d122145e311ae35 # This PR. hooks: - - id: "jlfmt" \ No newline at end of file + - id: "jlfmt" + args: ["--jlfmt-path=~/.julia/bin/jlfmt"] \ No newline at end of file From b9f92c69c77af21ca01c9a87b0736453ea06bf8c Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Tue, 26 May 2026 23:59:05 +0200 Subject: [PATCH 5/6] Update .pre-commit-config.yaml Co-authored-by: Penelope Yong --- .pre-commit-config.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e366868d..9e837f6d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,5 +2,4 @@ repos: - repo: https://github.com/JuliaEditorSupport/JuliaFormatter.jl rev: 3b196afa4a8ed92ba816edec6d122145e311ae35 # This PR. hooks: - - id: "jlfmt" - args: ["--jlfmt-path=~/.julia/bin/jlfmt"] \ No newline at end of file + - id: "jlfmt" \ No newline at end of file From 4fbb65131906d66265e58398cd204d72ce69e382 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Tue, 26 May 2026 23:59:12 +0200 Subject: [PATCH 6/6] Update .pre-commit-config.yaml Co-authored-by: Penelope Yong --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9e837f6d..67d993b5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ repos: - repo: https://github.com/JuliaEditorSupport/JuliaFormatter.jl - rev: 3b196afa4a8ed92ba816edec6d122145e311ae35 # This PR. + rev: 0935890389c9fbc45f4ee150064c0abe5340b6a9 # v2.4.0 hooks: - id: "jlfmt" \ No newline at end of file