Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide undocumented functions in Plug.Debugger #999

Merged
merged 1 commit into from
Dec 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/plug/debugger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ defmodule Plug.Debugger do
end
end

@doc false
def run_action(%Plug.Conn{} = conn) do
with %Plug.Conn{body_params: params} <- fetch_body_params(conn),
{:ok, {module, function, args}} <-
Expand All @@ -245,6 +246,7 @@ defmodule Plug.Debugger do
end
end

@doc false
def encoded_actions_for_exception(exception, conn) do
exception_implementation = Plug.Exception.impl_for(exception)

Expand All @@ -265,10 +267,10 @@ defmodule Plug.Debugger do
end
end

def actions_redirect_path(%Plug.Conn{method: "GET", request_path: request_path}),
defp actions_redirect_path(%Plug.Conn{method: "GET", request_path: request_path}),
do: request_path

def actions_redirect_path(conn) do
defp actions_redirect_path(conn) do
case get_req_header(conn, "referer") do
[referer] -> referer
[] -> "/"
Expand Down Expand Up @@ -387,7 +389,7 @@ defmodule Plug.Debugger do
end
end

def has_docs?(module, name, arity) do
defp has_docs?(module, name, arity) do
case Code.fetch_docs(module) do
{:docs_v1, _, _, _, module_doc, _, docs} when module_doc != :hidden ->
Enum.any?(docs, has_doc_matcher?(name, arity))
Expand Down