Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-alt committed Jul 6, 2023
1 parent 23d2bc3 commit ff47953
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 29 deletions.
7 changes: 7 additions & 0 deletions .JuliaFormatter.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Pkg # Load package manager
Pkg.add("JuliaFormatter") # Install JuliaFormatter

using JuliaFormatter # Load JuliaFormatter
format("."; verbose=true) # Format all files

Pkg.rm("JuliaFormatter") # Remove JuliaFormatter
3 changes: 2 additions & 1 deletion .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
style = "blue"
style = "blue"
pipe_to_function_call = false
28 changes: 0 additions & 28 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
format:
name: Julia Style Check
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.8'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- name: Install JuliaFormatter and format
run: |
julia -e 'using Pkg; Pkg.add("JuliaFormatter")'
julia -e 'using JuliaFormatter; while !format(".", BlueStyle()) end'
- name: Format check
run: |
julia -e '
out = Cmd(`git diff --name-only`) |> read |> String
if out == ""
exit(0)
else
@error "The following files are not formatted:\n $out"
exit(1)
end'
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Format Check

on:
push:
branches:
- 'main'
- 'release-'
tags: '*'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
with:
version: 1
- uses: actions/checkout@v1
- name: Install JuliaFormatter
run: |
using Pkg
Pkg.add("JuliaFormatter")
shell: julia --color=yes {0}
- name: Format code
run: |
using JuliaFormatter
format("."; verbose=true)
shell: julia --color=yes {0}
- name: Suggest formatting changes
uses: reviewdog/action-suggester@v1
if: github.event_name == 'pull_request'
with:
tool_name: JuliaFormatter
fail_on_error: true

0 comments on commit ff47953

Please sign in to comment.