* letter and Set the consts * use julia-code-style-suggesters * remove superfluous name * edit by copy of code-style-suggesters * delete stuff * remove using * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
5c2cc926a6
commit
dbe81dabd5
67
.github/workflows/format_check.yml
vendored
67
.github/workflows/format_check.yml
vendored
@ -1,37 +1,54 @@
|
|||||||
name: format
|
name: format
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
tags: '*'
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
code-style:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
julia-version: ['1']
|
|
||||||
julia-arch: [x64]
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: julia-actions/setup-julia@latest
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.julia-version }}
|
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install JuliaFormatter and format
|
- uses: julia-actions/setup-julia@v1
|
||||||
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
|
using Pkg
|
||||||
julia -e 'using JuliaFormatter; format(["src", "test"], verbose=true)'
|
Pkg.add([
|
||||||
- name: Format check
|
PackageSpec("JuliaFormatter"),
|
||||||
|
PackageSpec(url = "https://github.com/tkf/JuliaProjectFormatter.jl.git"),
|
||||||
|
])
|
||||||
|
shell: julia --color=yes {0}
|
||||||
|
|
||||||
|
- name: Format Julia files
|
||||||
run: |
|
run: |
|
||||||
julia -e '
|
using JuliaFormatter
|
||||||
out = Cmd(`git diff --name-only`) |> read |> String
|
format(["src", "test"])
|
||||||
if out == ""
|
shell: julia --color=yes --compile=min -O0 {0}
|
||||||
exit(0)
|
- name: suggester / JuliaFormatter
|
||||||
else
|
uses: reviewdog/action-suggester@v1
|
||||||
@error "These files have not been formatted:\n$out"
|
with:
|
||||||
exit(1)
|
tool_name: JuliaFormatter
|
||||||
end'
|
fail_on_error: true
|
||||||
|
|
||||||
|
# reviewdog/action-suggester not using `cleanup` flag?
|
||||||
|
- name: Cleanup
|
||||||
|
if: success() || failure()
|
||||||
|
run: |
|
||||||
|
git checkout -- .
|
||||||
|
git clean --force
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Format Julia project files
|
||||||
|
if: success() || failure()
|
||||||
|
run: |
|
||||||
|
using JuliaProjectFormatter
|
||||||
|
format_projects()
|
||||||
|
shell: julia --color=yes --compile=min -O0 {0}
|
||||||
|
- name: suggester / JuliaProjectFormatter
|
||||||
|
if: success() || failure()
|
||||||
|
uses: reviewdog/action-suggester@v1
|
||||||
|
with:
|
||||||
|
tool_name: JuliaProjectFormatter
|
||||||
|
fail_on_error: true
|
||||||
|
|||||||
@ -41,29 +41,27 @@ const _initial_fontsizes =
|
|||||||
const _internal_args =
|
const _internal_args =
|
||||||
[:plot_object, :series_plotindex, :markershape_to_add, :letter, :idxfilter]
|
[:plot_object, :series_plotindex, :markershape_to_add, :letter, :idxfilter]
|
||||||
|
|
||||||
const _axis_args = sort(union(collect(keys(_axis_defaults))))
|
const _axis_args = Set(keys(_axis_defaults))
|
||||||
const _series_args = sort(union(collect(keys(_series_defaults))))
|
const _series_args = Set(keys(_series_defaults))
|
||||||
const _subplot_args = sort(union(collect(keys(_subplot_defaults))))
|
const _subplot_args = Set(keys(_subplot_defaults))
|
||||||
const _plot_args = sort(union(collect(keys(_plot_defaults))))
|
const _plot_args = Set(keys(_plot_defaults))
|
||||||
|
|
||||||
const _magic_axis_args = [:axis, :tickfont, :guidefont, :grid, :minorgrid]
|
const _magic_axis_args = [:axis, :tickfont, :guidefont, :grid, :minorgrid]
|
||||||
const _magic_subplot_args =
|
const _magic_subplot_args =
|
||||||
[:title_font, :legend_font, :legend_title_font, :plot_title_font, :colorbar_titlefont]
|
[:title_font, :legend_font, :legend_title_font, :plot_title_font, :colorbar_titlefont]
|
||||||
const _magic_series_args = [:line, :marker, :fill]
|
const _magic_series_args = [:line, :marker, :fill]
|
||||||
const _all_magic_args =
|
const _all_magic_args =
|
||||||
sort(union(_magic_axis_args, _magic_series_args, _magic_subplot_args))
|
Set(union(_magic_axis_args, _magic_series_args, _magic_subplot_args))
|
||||||
|
|
||||||
const _all_axis_args = sort(union([_axis_args; _magic_axis_args]))
|
const _all_axis_args = union(_axis_args, _magic_axis_args)
|
||||||
const _all_subplot_args = sort(union([_subplot_args; _magic_subplot_args]))
|
const _lettered_all_axis_args =
|
||||||
const _all_series_args = sort(union([_series_args; _magic_series_args]))
|
Set([Symbol(letter, kw) for letter in (:x, :y, :z) for kw in _all_axis_args])
|
||||||
|
const _all_subplot_args = union(_subplot_args, _magic_subplot_args)
|
||||||
|
const _all_series_args = union(_series_args, _magic_series_args)
|
||||||
const _all_plot_args = _plot_args
|
const _all_plot_args = _plot_args
|
||||||
|
|
||||||
const _all_args = sort(union([
|
const _all_args =
|
||||||
_all_axis_args
|
union(_lettered_all_axis_args, _all_subplot_args, _all_series_args, _all_plot_args)
|
||||||
_all_subplot_args
|
|
||||||
_all_series_args
|
|
||||||
_all_plot_args
|
|
||||||
]))
|
|
||||||
|
|
||||||
# add all pluralized forms to the _keyAliases dict
|
# add all pluralized forms to the _keyAliases dict
|
||||||
for arg in _all_args
|
for arg in _all_args
|
||||||
|
|||||||
@ -8,3 +8,11 @@ using Plots, Test
|
|||||||
@test hline!(deepcopy(pl), [1.75], z_order = :back)[1].series_list[1][:label] == "y3"
|
@test hline!(deepcopy(pl), [1.75], z_order = :back)[1].series_list[1][:label] == "y3"
|
||||||
@test hline!(deepcopy(pl), [1.75], z_order = 2)[1].series_list[2][:label] == "y3"
|
@test hline!(deepcopy(pl), [1.75], z_order = 2)[1].series_list[2][:label] == "y3"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@testset "Axis Attributes" begin
|
||||||
|
pl = @test_nowarn plot(; tickfont = font(10, "Times"))
|
||||||
|
for axis in (:xaxis, :yaxis, :zaxis)
|
||||||
|
@test pl[1][axis][:tickfontsize] == 10
|
||||||
|
@test pl[1][axis][:tickfontfamily] == "Times"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user