Skip to content

Commit

Permalink
Setup JuliaFormatter + reviewdog/action-suggester
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed May 23, 2022
1 parent 9dd993e commit c466ecb
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
always_for_in = true
36 changes: 36 additions & 0 deletions .github/workflows/JuliaFormatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Code style

on:
pull_request:

jobs:
JuliaFormatter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- name: Install dependencies
run: |
using Pkg
Pkg.add("JuliaFormatter")
shell: julia --color=yes {0}
- name: Format Julia files
run: |
using JuliaFormatter
base = ENV["GITHUB_BASE_REF"] # "main"
run(`git fetch origin $base`)
cmd = `git diff -z --name-only origin/$base`
files = split(read(cmd, String), '\0')
filter!(endswith(".jl"), files)
println("Formatting:")
foreach(println, files)
format(files)
shell: julia --color=yes --compile=min -O0 {0}
- name: suggester / JuliaFormatter
uses: reviewdog/action-suggester@v1
with:
tool_name: JuliaFormatter

0 comments on commit c466ecb

Please sign in to comment.