Skip to content

Commit

Permalink
chore: Fix build warnings
Browse files Browse the repository at this point in the history
Although we are not building anything new with `gen_queue`, it is still worth
fixing some minor issues.

1. Switch from Travis to GHA.
2. Change `@since …` attributes to `@doc since: …`.
3. Run `mix format`.
4. Make Elixir 1.15 the minimum version supported.
5. Fix a badly named test file.
  • Loading branch information
halostatue committed Jul 16, 2024
1 parent b755794 commit b1186b2
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 15 deletions.
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
actions-minor:
update-types:
- minor
- patch

- package-ecosystem: mix
directory: /
schedule:
interval: monthly
groups:
elixir-development:
dependency-type: development
update-types:
- minor
- patch
elixir-production:
dependency-type: production
update-types:
- patch
63 changes: 63 additions & 0 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Elixir CI

on:
pull_request:
push:
branches:
- main
workflow_dispatch:

jobs:
elixir-ci:
name: Elixir ${{ matrix.elixir }} (OTP ${{ matrix.otp }})

env:
LANG: en_US.UTF-8
LC_CTYPE: en_US.UTF-8

strategy:
fail-fast: true
matrix:
include:
- elixir: '1.15'
otp: '26'
os: ubuntu-22.04
check_formatted: true
warnings_as_errors: true
- elixir: '1.16'
otp: '26'
os: ubuntu-22.04
- elixir: '1.17'
otp: '27'
os: ubuntu-22.04

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- uses: erlef/setup-elixir@v1
id: install
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}

- uses: actions/cache@v4
with:
key: builds@elixir-${{ steps.install.outputs.elixir-version }}-otp-${{ steps.install.outputs.otp-version }}-mix-${{ hashFiles('mix.lock') }}
path: |
deps
_build
- run: mix 'do' deps.get, deps.compile

- run: mix format --check-formatted
if: matrix.check_formatted

- run: mix compile --warnings-as-errors
if: matrix.warnings_as_errors

- run: mix compile
if: ${{ !matrix.warnings_as_errors }}

- run: mix test
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions lib/gen_queue.ex
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ defmodule GenQueue do
GenQueue.adapter(MyQueue, [otp_app: :my_app])
"""
@since "0.1.7"
@doc since: "0.1.7"
@spec adapter(GenQueue.t(), opts :: Keyword.t()) :: GenQueue.Adapter.t()
def adapter(gen_queue, opts \\ [])

Expand Down Expand Up @@ -289,7 +289,7 @@ defmodule GenQueue do
# Returns the provided options
GenQueue.config(MyQueue, [adapter: MyAdapter])
"""
@since "0.1.7"
@doc since: "0.1.7"
@spec config(GenQueue.t(), opts :: Keyword.t()) :: GenQueue.Adapter.t()
def config(gen_queue, opts \\ [])

Expand Down
2 changes: 1 addition & 1 deletion lib/gen_queue/job.ex
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ defmodule GenQueue.Job do

@spec new(module, list, options) :: GenQueue.Job.t()
def new(module, args, opts) when is_list(args) do
job = Keyword.merge(opts, [module: module, args: args])
job = Keyword.merge(opts, module: module, args: args)
struct(__MODULE__, job)
end
end
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
defmodule GenQueue.Mixfile do
use Mix.Project

@version "0.1.8"
@version "0.2.0"

def project do
[
app: :gen_queue,
version: @version,
elixir: "~> 1.6",
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
deps: deps(),
description: description(),
Expand Down
9 changes: 7 additions & 2 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
%{
"earmark": {:hex, :earmark, "1.2.5", "4d21980d5d2862a2e13ec3c49ad9ad783ffc7ca5769cf6ff891a4553fbaae761", [:mix], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.18.3", "f4b0e4a2ec6f333dccf761838a4b253d75e11f714b85ae271c9ae361367897b7", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"},
"earmark": {:hex, :earmark, "1.2.5", "4d21980d5d2862a2e13ec3c49ad9ad783ffc7ca5769cf6ff891a4553fbaae761", [:mix], [], "hexpm", "c57508ddad47dfb8038ca6de1e616e66e9b87313220ac5d9817bc4a4dc2257b9"},
"earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"},
"ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"},
"makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"},
"makeup_erlang": {:hex, :makeup_erlang, "1.0.0", "6f0eff9c9c489f26b69b61440bf1b238d95badae49adac77973cbacae87e3c2e", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "ea7a9307de9d1548d2a72d299058d1fd2339e3d398560a0e46c27dab4891e4d2"},
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
}
1 change: 0 additions & 1 deletion test/gen_queue/job_test.ex → test/gen_queue/job_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ defmodule GenQueue.JobTest do
end
end
end

0 comments on commit b1186b2

Please sign in to comment.