From 80046094b82e1ecd5e0ed1a27b13700c93e2cb03 Mon Sep 17 00:00:00 2001 From: Willem van den Ende Date: Wed, 18 Mar 2026 15:03:24 +0000 Subject: [PATCH] update blog post, and run credo with 'pi' --- Makefile | 27 ++++++++ app/Makefile | 32 ++++++++++ app/lib/firehose/blogs/engineering_blog.ex | 3 + app/lib/firehose/blogs/release_notes.ex | 3 + app/lib/firehose_web.ex | 2 +- .../components/core_components.ex | 3 +- .../components/layouts/app.html.heex | 5 +- .../controllers/blog_controller.ex | 1 + .../controllers/page_html/home.html.heex | 11 +++- app/mix.exs | 3 +- app/mix.lock | 2 + .../engineering/2026/03-17-why-firehose.md | 22 ++++--- .../firehose_web/controllers/blog_test.exs | 4 +- app/test/support/data_case.ex | 5 +- planner_request.md | 61 +++++++++++++++++++ 15 files changed, 165 insertions(+), 19 deletions(-) create mode 100644 Makefile create mode 100644 app/Makefile create mode 100644 planner_request.md diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6d8433d --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +# Makefile for Firehose monorepo + +.PHONY: check precommit deps compile test format + +# Common check target that runs all static analysis +check: + @echo "Running static analysis..." + @make -C app MISE_BIN=/home/vscode/.local/bin/mise check + +# Precommit target for CI/pre-commit hooks +precommit: check + +# Sync dependencies +deps: + @make -C app deps + +# Compile the project +compile: + @make -C app compile + +# Run tests +test: + @make -C app test + +# Format code +format: + @make -C app format \ No newline at end of file diff --git a/app/Makefile b/app/Makefile new file mode 100644 index 0000000..bf93fee --- /dev/null +++ b/app/Makefile @@ -0,0 +1,32 @@ +# Makefile for Firehose app + +MISE_BIN ?= /home/vscode/.local/bin/mise +MISE_EXEC = $(MISE_BIN) exec -- + +.PHONY: check precommit deps compile test format credo + +# Run all static analysis checks +check: credo format + +# Precommit target for CI/pre-commit hooks +precommit: check compile + +# Sync dependencies +deps: + $(MISE_EXEC) mix deps.get + +# Compile the project +compile: + $(MISE_EXEC) mix compile --warnings-as-errors + +# Run tests +test: deps + $(MISE_EXEC) mix test + +# Format code +format: + $(MISE_EXEC) mix format + +# Run Credo static analysis +credo: + $(MISE_EXEC) mix credo --strict \ No newline at end of file diff --git a/app/lib/firehose/blogs/engineering_blog.ex b/app/lib/firehose/blogs/engineering_blog.ex index cf13544..344adee 100644 --- a/app/lib/firehose/blogs/engineering_blog.ex +++ b/app/lib/firehose/blogs/engineering_blog.ex @@ -1,4 +1,7 @@ defmodule Firehose.EngineeringBlog do + @moduledoc """ + Engineering blog configuration. + """ use Blogex.Blog, blog_id: :engineering, app: :firehose, diff --git a/app/lib/firehose/blogs/release_notes.ex b/app/lib/firehose/blogs/release_notes.ex index 4153c97..f9d3f37 100644 --- a/app/lib/firehose/blogs/release_notes.ex +++ b/app/lib/firehose/blogs/release_notes.ex @@ -1,4 +1,7 @@ defmodule Firehose.ReleaseNotes do + @moduledoc """ + Release notes blog configuration. + """ use Blogex.Blog, blog_id: :release_notes, app: :firehose, diff --git a/app/lib/firehose_web.ex b/app/lib/firehose_web.ex index 2579d3a..0aa22ea 100644 --- a/app/lib/firehose_web.ex +++ b/app/lib/firehose_web.ex @@ -88,8 +88,8 @@ defmodule FirehoseWeb do import FirehoseWeb.CoreComponents # Common modules used in templates - alias Phoenix.LiveView.JS alias FirehoseWeb.Layouts + alias Phoenix.LiveView.JS # Routes generation with the ~p sigil unquote(verified_routes()) diff --git a/app/lib/firehose_web/components/core_components.ex b/app/lib/firehose_web/components/core_components.ex index 603479e..dcb60ad 100644 --- a/app/lib/firehose_web/components/core_components.ex +++ b/app/lib/firehose_web/components/core_components.ex @@ -29,6 +29,7 @@ defmodule FirehoseWeb.CoreComponents do use Phoenix.Component use Gettext, backend: FirehoseWeb.Gettext + alias Phoenix.HTML.Form alias Phoenix.LiveView.JS @doc """ @@ -181,7 +182,7 @@ defmodule FirehoseWeb.CoreComponents do def input(%{type: "checkbox"} = assigns) do assigns = assign_new(assigns, :checked, fn -> - Phoenix.HTML.Form.normalize_value("checkbox", assigns[:value]) + Form.normalize_value("checkbox", assigns[:value]) end) ~H""" diff --git a/app/lib/firehose_web/components/layouts/app.html.heex b/app/lib/firehose_web/components/layouts/app.html.heex index 2d81710..4efb292 100644 --- a/app/lib/firehose_web/components/layouts/app.html.heex +++ b/app/lib/firehose_web/components/layouts/app.html.heex @@ -1,6 +1,9 @@