mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-08 14:04:31 +08:00
Fix dialyzer warnings (#1691)
This commit is contained in:
parent
5d651cf5c7
commit
e622ef4f96
8 changed files with 14 additions and 8 deletions
|
@ -254,6 +254,8 @@ defmodule Livebook.Application do
|
|||
end
|
||||
end
|
||||
|
||||
@dialyzer {:no_return, iframe_port_in_use: 1}
|
||||
|
||||
defp iframe_port_in_use(port) do
|
||||
Livebook.Config.abort!(
|
||||
"Failed to start Livebook iframe server because port #{port} is already in use"
|
||||
|
|
|
@ -132,7 +132,7 @@ defmodule Livebook.Config do
|
|||
@doc """
|
||||
Returns an mfa if there's a way to shut down the system.
|
||||
"""
|
||||
@spec shutdown_callback() :: mfa() | nil
|
||||
@spec shutdown_callback() :: {module(), atom(), list()} | nil
|
||||
def shutdown_callback() do
|
||||
Application.fetch_env!(:livebook, :shutdown_callback)
|
||||
end
|
||||
|
|
|
@ -13,7 +13,7 @@ defmodule Livebook.Notebook.Cell.Code do
|
|||
|
||||
@type t :: %__MODULE__{
|
||||
id: Cell.id(),
|
||||
source: String.t(),
|
||||
source: String.t() | :__pruned__,
|
||||
outputs: list(Cell.indexed_output()),
|
||||
disable_formatting: boolean(),
|
||||
reevaluate_automatically: boolean()
|
||||
|
|
|
@ -13,7 +13,7 @@ defmodule Livebook.Notebook.Cell.Markdown do
|
|||
|
||||
@type t :: %__MODULE__{
|
||||
id: Cell.id(),
|
||||
source: String.t()
|
||||
source: String.t() | :__pruned__
|
||||
}
|
||||
|
||||
@doc """
|
||||
|
|
|
@ -10,11 +10,11 @@ defmodule Livebook.Notebook.Cell.Smart do
|
|||
|
||||
@type t :: %__MODULE__{
|
||||
id: Cell.id(),
|
||||
source: String.t(),
|
||||
source: String.t() | :__pruned__,
|
||||
chunks: Livebook.Runtime.chunks() | nil,
|
||||
outputs: list(Cell.indexed_output()),
|
||||
kind: String.t(),
|
||||
attrs: attrs(),
|
||||
kind: String.t() | nil,
|
||||
attrs: attrs() | :__pruned__,
|
||||
js_view: Livebook.Runtime.js_view() | nil,
|
||||
editor: Livebook.Runtime.editor() | nil
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@ defmodule Livebook.Settings.EnvVar do
|
|||
import Ecto.Changeset
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
name: String.t(),
|
||||
value: String.t()
|
||||
name: String.t() | nil,
|
||||
value: String.t() | nil
|
||||
}
|
||||
|
||||
@primary_key {:name, :string, autogenerate: false}
|
||||
|
|
2
mix.exs
2
mix.exs
|
@ -153,6 +153,8 @@ defmodule Livebook.MixProject do
|
|||
release
|
||||
end
|
||||
|
||||
@compile {:no_warn_undefined, Standalone}
|
||||
|
||||
defp standalone_erlang_elixir(release) do
|
||||
Code.require_file("rel/app/standalone.exs")
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@ defmodule Livebook.TestModules.BadInspect do
|
|||
defstruct []
|
||||
|
||||
defimpl Inspect do
|
||||
@dialyzer {:nowarn_function, inspect: 2}
|
||||
|
||||
def inspect(%Livebook.TestModules.BadInspect{}, _opts) do
|
||||
:bad_return
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue