chore: credo/ci

This commit is contained in:
Zach Daniel 2023-10-21 22:43:34 -04:00
parent f91087bbb6
commit e22fb218e8
9 changed files with 17 additions and 2 deletions

View file

@ -123,7 +123,7 @@
{Credo.Check.Refactor.MatchInCondition, []},
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
{Credo.Check.Refactor.Nesting, [max_nesting: 6]},
{Credo.Check.Refactor.Nesting, [max_nesting: 8]},
{Credo.Check.Refactor.UnlessWithElse, []},
{Credo.Check.Refactor.WithClauses, []},

View file

@ -1,5 +1,6 @@
defmodule AshJsonApiWrapper do
@moduledoc """
Functions for interacting with AshJsonApiWrapper changesets and queries.
"""
@spec set_body_param(query_or_changeset, String.t(), any) :: query_or_changeset

View file

@ -1,4 +1,8 @@
defmodule AshJsonApiWrapper.DataLayer do
@moduledoc """
A data layer for wrapping external JSON APIs.
"""
@field %Spark.Dsl.Entity{
name: :field,
target: AshJsonApiWrapper.Field,
@ -127,6 +131,7 @@ defmodule AshJsonApiWrapper.DataLayer do
transformers: [AshJsonApiWrapper.DataLayer.Transformers.SetEndpointDefaults]
defmodule Query do
@moduledoc false
defstruct [
:api,
:context,

View file

@ -1,4 +1,5 @@
defmodule AshJsonApiWrapper.DataLayer.Transformers.SetEndpointDefaults do
@moduledoc false
use Spark.Dsl.Transformer
alias Spark.Dsl.Transformer

View file

@ -1,4 +1,8 @@
defmodule AshJsonApiWrapper.DefaultTesla do
@moduledoc """
A bare bones tesla implementation used by default if one is not provided.
"""
use Tesla
plug(Tesla.Middleware.FollowRedirects)

View file

@ -1,4 +1,5 @@
defmodule AshJsonApiWrapper.Field do
@moduledoc "Represents a field mapped in the target api."
defstruct [:name, :path, :write_path, :filter_handler]
@type t :: %__MODULE__{}

View file

@ -1,4 +1,6 @@
defmodule AshJsonApiWrapper.OpenApi.ResourceGenerator do
@moduledoc "Generates resources from an open api specification"
def generate(json, main_config) do
main_config[:resources]
|> Enum.map(fn {resource, config} ->

View file

@ -1,4 +1,5 @@
defmodule AshJsonApiWrapper.Paginator.ContinuationProperty do
@moduledoc "A paginator that uses a continuation property to paginate"
use AshJsonApiWrapper.Paginator
def continue(_response, [], _), do: :halt

View file

@ -133,7 +133,7 @@ defmodule AshJsonApiWrapper.MixProject do
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ash, "~> 2.15"},
{:ash, ash_version("~> 2.15")},
{:tesla, "~> 1.7"},
{:exjsonpath, "~> 0.1"},
# Dev/Test dependencies