From b7f188a6dc831ea78afef10efa105c1415f71e9e Mon Sep 17 00:00:00 2001 From: t-bltg Date: Fri, 1 Nov 2024 18:50:29 +0100 Subject: [PATCH] support `Colors` 0.13 - add `codespell` action (#171) --- .github/workflows/ci.yml | 6 ++++- .github/workflows/codespell.yml | 17 ++++++++++++ .github/workflows/invalidations.yml | 41 ----------------------------- Project.toml | 2 +- src/adapted_grid.jl | 2 +- src/ticks.jl | 2 +- test/runtests.jl | 10 +++---- 7 files changed, 30 insertions(+), 50 deletions(-) create mode 100644 .github/workflows/codespell.yml delete mode 100644 .github/workflows/invalidations.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1128781..0502e87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,17 +25,21 @@ jobs: matrix: version: - '1.6' # LTS (lowest supported `julia` version declared in `Project.toml`) + - 'lts' - '1' # latest stable experimental: - false os: [ubuntu-latest, windows-latest, macos-latest] arch: [x64, x86] exclude: - # Test 32-bit only on Linux + # test 32-bit only on Linux - os: macos-latest arch: x86 - os: windows-latest arch: x86 + # https://discourse.julialang.org/t/how-to-fix-github-actions-ci-failures-with-julia-1-6-or-1-7-on-macos-latest-and-macos-14 + - os: macos-latest + version: '1.6' include: - version: 'nightly' os: ubuntu-latest diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..089a30d --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,17 @@ +name: codespell + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: codespell-project/actions-codespell@v2 + with: + ignore_words_list: indexin + only_warn: 0 diff --git a/.github/workflows/invalidations.yml b/.github/workflows/invalidations.yml deleted file mode 100644 index 94fb8c2..0000000 --- a/.github/workflows/invalidations.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: invalidations - -on: - pull_request: - push: - branches: [master] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: julia-actions/setup-julia@latest - with: - version: '1' - - uses: actions/checkout@v4 - - uses: julia-actions/julia-buildpkg@latest - - uses: julia-actions/julia-invalidations@v1 - id: invs_pr - - - uses: actions/checkout@v4 - with: - ref: 'master' - - uses: julia-actions/julia-buildpkg@latest - - uses: julia-actions/julia-invalidations@v1 - id: invs_master - - - name: Report invalidation counts - run: | - echo "Invalidations on master: ${{ steps.invs_master.outputs.total }} (${{ steps.invs_master.outputs.deps }} via deps)" - echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" - shell: bash - - name: PR doesn't increase number of invalidations - run: | - if (( ${{ steps.invs_pr.outputs.total }} > ${{ steps.invs_master.outputs.total }} )); then - exit 1 - fi - shell: bash diff --git a/Project.toml b/Project.toml index 397b86f..749e294 100644 --- a/Project.toml +++ b/Project.toml @@ -15,7 +15,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] ColorSchemes = "3.19 - 4" -Colors = "0.12" +Colors = "0.12 - 0.13" Dates = "<0.0.1, 1" PrecompileTools = "1" Printf = "<0.0.1, 1" diff --git a/src/adapted_grid.jl b/src/adapted_grid.jl index 5ea80a8..700233e 100644 --- a/src/adapted_grid.jl +++ b/src/adapted_grid.jl @@ -16,7 +16,7 @@ function adapted_grid( minmax::Tuple{Number,Number}; max_recursions = 7, max_curvature = 0.01, - n_points = 31 + n_points = 31, ) if minmax[1] > minmax[2] throw(ArgumentError("interval must be given as (min, max)")) diff --git a/src/ticks.jl b/src/ticks.jl index 1d7e9e4..51b11bf 100644 --- a/src/ticks.jl +++ b/src/ticks.jl @@ -399,7 +399,7 @@ function optimize_ticks( Millisecond(1), ] - # ticks on week boundries + # ticks on week boundaries if x_min + Day(7) < x_max || scale ≡ :week push!(ticks, x_min) while true diff --git a/test/runtests.jl b/test/runtests.jl index 7029fbe..95ddac9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -21,7 +21,7 @@ const C0 = RGBA{PlotUtils.Colors.N0f8} @test plot_color(:red) == parse(C, :red) @test plot_color("red") == parse(C, "red") - @test_throws ErrorException plot_color("notacolor") + @test_throws ArgumentError plot_color("notacolor") @test plot_color(colorant"red") == C(1, 0, 0, 1) @@ -83,7 +83,7 @@ end @testset "sampling" begin # github.com/MakieOrg/Makie.jl/issues/2635 cmap = cgrad([:black, :white, :orange], [0, 0.2, 1]) - # sample ouside the given values + # sample outside the given values @test RGB(get(cmap, 0.15)) ≈ RGB(0.75, 0.75, 0.75) @test RGB(get(cmap, 0.5)) ≈ RGB(1.0, 0.86764705, 0.625) @test RGB(get(cmap, 0.8)) ≈ RGB(1.0, 0.73529411, 0.25) @@ -91,7 +91,7 @@ end @testset "reverse" begin cmap = reverse(cgrad([:black, :white, :orange], [0, 0.2, 1])) - # sample ouside the given values + # sample outside the given values @test RGB(get(cmap, 0.15)) ≈ RGB(1.0, 0.71323529, 0.1875) @test RGB(get(cmap, 0.5)) ≈ RGB(1.0, 0.86764705, 0.625) @test RGB(get(cmap, 0.75)) ≈ RGB(1.0, 0.97794117, 0.9375) @@ -274,8 +274,8 @@ end let f = sinc, int = (-40, 40) # JuliaPlots/Plots.jl/issues/3894 xs, fs = adapted_grid(sinc, int) roots = vcat(int[1]:-1, 1:int[2]) - count_per_extrema = map(1:length(roots)-1) do idx - left = roots[idx]; right = roots[idx+1] + count_per_extrema = map(1:(length(roots) - 1)) do idx + left, right = roots[idx:(idx + 1)] return count(x -> left < x < right, xs) end # check that we have at least 5 points for each extrema