add format check

This commit is contained in:
t-bltg 2022-01-21 11:39:46 +01:00
parent bcd98737bb
commit 61c05e1730
4 changed files with 52 additions and 29 deletions

View File

@ -1,22 +0,0 @@
name: format
on:
pull_request:
jobs:
JuliaFormatter:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: 1
# Check format
- name: Install JuliaFormatter and format
run: |
git diff --name-only --exit-code
julia -e 'using Pkg; pkg"add JuliaFormatter CSTParser#master"'
julia -e 'using JuliaFormatter; [format(["src", "test"]) for _ in 1:2]'
git diff --exit-code

38
.github/workflows/format_check.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: format
on:
push:
branches:
- 'master'
tags: '*'
pull_request:
jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ['1']
julia-arch: [x64]
os: [ubuntu-latest]
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- uses: actions/checkout@v2
- name: Install JuliaFormatter and format
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
julia -e 'using JuliaFormatter; format(["src", "test"], verbose=true)'
- name: Format check
run: |
julia -e '
out = Cmd(`git diff --name-only`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end'

View File

@ -1,19 +1,19 @@
name: format-pr
name: format
on:
schedule:
- cron: '0 0 * * SUN'
- cron: '0 0 1 * *'
jobs:
build:
pr:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install JuliaFormatter and format
run: |
julia -e 'using Pkg; pkg"add JuliaFormatter"'
julia -e 'using JuliaFormatter; [format(["src", "test"]) for _ in 1:2]'
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
julia -e 'using JuliaFormatter; [format(["src", "test"]) for _ in 1:2]'
git diff --exit-code
- name: Create Pull Request

View File

@ -144,8 +144,15 @@ function addUnicodeSeries!(
colorbar = hascolorbar(sp),
)
if st === :contour
isfilledcontour(series) && @warn "Plots(UnicodePlots): filled contour is not implemented"
return UnicodePlots.contourplot(x, y, series[:z].surf; kw..., levels = series[:levels])
isfilledcontour(series) &&
@warn "Plots(UnicodePlots): filled contour is not implemented"
return UnicodePlots.contourplot(
x,
y,
series[:z].surf;
kw...,
levels = series[:levels],
)
elseif st === :heatmap
return UnicodePlots.heatmap(series[:z].surf; fix_ar = _up_fix_ar[], kw...)
# zlim = collect(axis_limits(sp, :z))