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

Add format suggestions to CI #2118

Merged
merged 12 commits into from
Oct 22, 2024
17 changes: 13 additions & 4 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: format-check
name: Format check and suggestions

on:
push:
branches:
- 'main'
tags: '*'
pull_request:
# this argument is not required if you don't use the `suggestion-label` input
types: [opened, reopened, synchronize, labeled, unlabeled]

huiyuxie marked this conversation as resolved.
Show resolved Hide resolved
jobs:
check-format:
Expand All @@ -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 '
Expand All @@ -42,3 +42,12 @@ jobs:
write(stdout, out)
exit(1)
end'

format-suggestions:
runs-on: ubuntu-latest
huiyuxie marked this conversation as resolved.
Show resolved Hide resolved
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
huiyuxie marked this conversation as resolved.
Show resolved Hide resolved
Loading