fix: reworking some code smell issues

This commit is contained in:
2026-06-26 16:34:07 +02:00
parent 68de265137
commit d1acfd4d71
42 changed files with 661 additions and 129 deletions

View File

@@ -312,7 +312,7 @@ defmodule BDS.Desktop.ShellLive.SettingsEditor.AISettings do
defp normalize_endpoint_result({:ok, _endpoint}), do: :ok
defp normalize_endpoint_result({:error, reason}), do: {:error, reason}
defp truthy?(value), do: value in [true, "true", "on", "1", 1]
defp truthy?(value), do: BDS.Values.truthy?(value)
defp blank_to_nil(nil), do: nil

View File

@@ -77,7 +77,7 @@ defmodule BDS.Desktop.ShellLive.SettingsEditor.EditorSettings do
}
end
defp truthy?(value), do: value in [true, "true", "on", "1", 1]
defp truthy?(value), do: BDS.Values.truthy?(value)
defp boolean_string(true), do: "true"
defp boolean_string(false), do: "false"
end

View File

@@ -187,7 +187,7 @@ defmodule BDS.Desktop.ShellLive.SettingsEditor.ManagedCategories do
end)
end
defp truthy?(value), do: value in [true, "true", "on", "1", 1]
defp truthy?(value), do: BDS.Values.truthy?(value)
defp blank_to_nil(nil), do: nil

View File

@@ -94,7 +94,7 @@ defmodule BDS.Desktop.ShellLive.SettingsEditor.ProjectSettings do
}
end
defp truthy?(value), do: value in [true, "true", "on", "1", 1]
defp truthy?(value), do: BDS.Values.truthy?(value)
defp parse_integer(nil, fallback), do: fallback
defp parse_integer(value, _fallback) when is_integer(value), do: value