diff --git a/.github/workflows/format.yml.disabled b/.github/workflows/format.yml.disabled deleted file mode 100644 index 9fae7be9..00000000 --- a/.github/workflows/format.yml.disabled +++ /dev/null @@ -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 diff --git a/.github/workflows/format_check.yml b/.github/workflows/format_check.yml new file mode 100644 index 00000000..2ccd2b2c --- /dev/null +++ b/.github/workflows/format_check.yml @@ -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' diff --git a/.github/workflows/format_pr.yml b/.github/workflows/format_pr.yml index f547d1d5..649b065b 100644 --- a/.github/workflows/format_pr.yml +++ b/.github/workflows/format_pr.yml @@ -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 diff --git a/src/backends/unicodeplots.jl b/src/backends/unicodeplots.jl index ef09268d..2994acb4 100644 --- a/src/backends/unicodeplots.jl +++ b/src/backends/unicodeplots.jl @@ -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))