Add format check, reduce format PR frequency (#4053)
This commit is contained in:
parent
34e581ff3f
commit
ab698da5a4
22
.github/workflows/format.yml.disabled
vendored
22
.github/workflows/format.yml.disabled
vendored
@ -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
38
.github/workflows/format_check.yml
vendored
Normal 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'
|
||||||
10
.github/workflows/format_pr.yml
vendored
10
.github/workflows/format_pr.yml
vendored
@ -1,19 +1,19 @@
|
|||||||
name: format-pr
|
name: format
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * SUN'
|
- cron: '0 0 1 * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
pr:
|
||||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install JuliaFormatter and format
|
- name: Install JuliaFormatter and format
|
||||||
run: |
|
run: |
|
||||||
julia -e 'using Pkg; pkg"add JuliaFormatter"'
|
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
|
||||||
julia -e 'using JuliaFormatter; [format(["src", "test"]) for _ in 1:2]'
|
julia -e 'using JuliaFormatter; [format(["src", "test"]) for _ in 1:2]'
|
||||||
git diff --exit-code
|
git diff --exit-code
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
|
|||||||
@ -144,8 +144,15 @@ function addUnicodeSeries!(
|
|||||||
colorbar = hascolorbar(sp),
|
colorbar = hascolorbar(sp),
|
||||||
)
|
)
|
||||||
if st === :contour
|
if st === :contour
|
||||||
isfilledcontour(series) && @warn "Plots(UnicodePlots): filled contour is not implemented"
|
isfilledcontour(series) &&
|
||||||
return UnicodePlots.contourplot(x, y, series[:z].surf; kw..., levels = series[:levels])
|
@warn "Plots(UnicodePlots): filled contour is not implemented"
|
||||||
|
return UnicodePlots.contourplot(
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
series[:z].surf;
|
||||||
|
kw...,
|
||||||
|
levels = series[:levels],
|
||||||
|
)
|
||||||
elseif st === :heatmap
|
elseif st === :heatmap
|
||||||
return UnicodePlots.heatmap(series[:z].surf; fix_ar = _up_fix_ar[], kw...)
|
return UnicodePlots.heatmap(series[:z].surf; fix_ar = _up_fix_ar[], kw...)
|
||||||
# zlim = collect(axis_limits(sp, :z))
|
# zlim = collect(axis_limits(sp, :z))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user