Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
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