docs: fix dangling docs references

This commit is contained in:
Zach Daniel 2021-03-14 18:29:30 -04:00
parent 3c570bd679
commit 7eea6576a0
9 changed files with 30 additions and 38 deletions

View file

@ -28,6 +28,10 @@ defmodule Ash.Dsl do
]
]
@type entity :: %Ash.Dsl.Entity{}
@type section :: %Ash.Dsl.Section{}
@moduledoc """
The primary entry point for adding a DSL to a module.

View file

@ -46,19 +46,6 @@ defmodule Ash.Dsl.Entity do
auto_set_fields: []
]
@type t :: %__MODULE__{
name: atom,
describe: String.t(),
target: module,
examples: [String.t()],
transform: mfa | nil,
args: [atom],
hide: [atom],
entities: Keyword.t(),
auto_set_fields: Keyword.t(),
schema: Ash.OptionsHelpers.schema()
}
def build(
%{target: target, schema: schema, auto_set_fields: auto_set_fields, transform: transform},
opts,

View file

@ -102,7 +102,7 @@ defmodule Ash.Dsl.Extension do
See the documentation for `Ash.Dsl.Section` and `Ash.Dsl.Entity` for more information
"""
@callback sections() :: [Ash.Dsl.Section.t()]
@callback sections() :: [Ash.Dsl.section()]
@callback transformers() :: [module]
@doc "Get the entities configured for a given section"

View file

@ -30,13 +30,4 @@ defmodule Ash.Dsl.Section do
entities: [],
sections: []
]
@type t :: %__MODULE__{
name: atom,
describe: String.t(),
examples: [String.t()],
entities: [Ash.Dsl.Entity.t()],
sections: [%__MODULE__{}],
schema: Ash.OptionsHelpers.schema()
}
end

View file

@ -22,18 +22,6 @@ defmodule Ash.Helpers do
false
end
# A restricted version of `:erlang.binary_to_term/2` that forbids
# *executable* terms, such as anonymous functions.
# The `opts` are given to the underlying `:erlang.binary_to_term/2`
# call, with an empty list as a default.
# By default this function does not restrict atoms, as an atom
# interned in one node may not yet have been interned on another
# (except for releases, which preload all code).
# If you want to avoid atoms from being created, then you can pass
# `[:safe]` as options, as that will also enable the safety mechanisms
# from `:erlang.binary_to_term/2` itself.
# Ripped from https://github.com/elixir-plug/plug_crypto/blob/v1.2.0/lib/plug/crypto.ex
# sobelow_skip ["Misc.BinToTerm"]
def non_executable_binary_to_term(binary, opts \\ []) when is_binary(binary) do
term = :erlang.binary_to_term(binary, opts)

View file

@ -118,5 +118,18 @@ defmodule Ash.Page.Keyset do
Enum.map(fields, &Map.get(record, &1))
end
@doc """
A restricted version of `:erlang.binary_to_term/2` that forbids
*executable* terms, such as anonymous functions.
The `opts` are given to the underlying `:erlang.binary_to_term/2`
call, with an empty list as a default.
By default this function does not restrict atoms, as an atom
interned in one node may not yet have been interned on another
(except for releases, which preload all code).
If you want to avoid atoms from being created, then you can pass
`[:safe]` as options, as that will also enable the safety mechanisms
from `:erlang.binary_to_term/2` itself.
Ripped from https://github.com/elixir-plug/plug_crypto/blob/v1.2.0/lib/plug/crypto.ex
"""
defdelegate non_executable_binary_to_term(binary, opts), to: Ash.Helpers
end

View file

@ -1,5 +1,7 @@
defmodule Ash.Sort do
@moduledoc false
@moduledoc """
Utilities and types for sorting.
"""
alias Ash.Error.Query.{InvalidSortOrder, NoSuchAttribute}

View file

@ -1,5 +1,7 @@
defmodule Ash.SatSolver do
@moduledoc false
@moduledoc """
Tools for working with the satsolver that drives filter subset checking (for authorization)
"""
alias Ash.Filter
alias Ash.Query.{BooleanExpression, Not, Ref}

View file

@ -97,6 +97,10 @@ defmodule Ash.MixProject do
Ash.Resource.Dsl,
Ash.Api.Dsl
],
tools: [
Ash.Filter,
Ash.Sort
],
validations: ~r/Ash.Resource.Validation/,
changes: ~r/Ash.Resource.Change/,
calculations: [
@ -145,7 +149,8 @@ defmodule Ash.MixProject do
Ash.UUID,
Ash.NotLoaded,
Ash.Query.Aggregate,
Ash.Query.Type
Ash.Query.Type,
Ash.SatSolver
],
comparable: ~r/Comparable/
]