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