Apply quokka pipes rule

This commit is contained in:
Claudio Ortolina
2025-05-28 19:48:35 +01:00
parent ff8e27e619
commit 774f1c82e5
3 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -4,6 +4,6 @@
plugins: [Phoenix.LiveView.HTMLFormatter, Quokka],
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"],
quokka: [
only: [:module_directives]
only: [:module_directives, :pipes]
]
]
+2 -2
View File
@@ -66,7 +66,7 @@ defmodule LastFm.Session do
doc
end
defp first(node, path), do: node |> xpath(path) |> take_one
defp first(node, path), do: node |> xpath(path) |> take_one()
defp take_one([head | _]), do: head
defp take_one(_), do: nil
@@ -77,7 +77,7 @@ defmodule LastFm.Session do
:xmerl_xpath.string(to_charlist(path), node)
end
def text(node), do: node |> xpath(~c"./text()") |> extract_text
def text(node), do: node |> xpath(~c"./text()") |> extract_text()
defp extract_text([xmlText(value: value)]), do: List.to_string(value)
defp extract_text(_x), do: nil
+1 -2
View File
@@ -17,11 +17,10 @@ defmodule MusicLibraryWeb.Telemetry.Storage do
metric_histories_map =
metrics
|> Enum.map(fn metric ->
|> Map.new(fn metric ->
attach_handler(metric)
{metric, CircularBuffer.new(@history_buffer_size)}
end)
|> Map.new()
{:ok, metric_histories_map}
end