From 8d430ef6c25e24fe8b3005f1bbabbe45007864da Mon Sep 17 00:00:00 2001 From: Daniel Widgren Date: Thu, 12 Feb 2026 08:57:44 +0100 Subject: [PATCH 1/2] ci: add ex_doc generation step to CI Verify docs build on every push and PR. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/erlang.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/erlang.yml b/.github/workflows/erlang.yml index 11e98c8..6158699 100644 --- a/.github/workflows/erlang.yml +++ b/.github/workflows/erlang.yml @@ -60,6 +60,8 @@ jobs: run: rebar3 dialyzer - name: Run xref run: rebar3 xref + - name: Generate docs + run: rebar3 ex_doc nova_request_app: if: github.ref != 'refs/heads/main' needs: [build] From 3d5aae9e7227ae0c86c56aeaff08953034200b62 Mon Sep 17 00:00:00 2001 From: Daniel Widgren Date: Thu, 12 Feb 2026 12:54:14 +0100 Subject: [PATCH 2/2] fix: remove @doc tags from callbacks and export reply/0 type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit edoc does not support @doc tags on -callback declarations — it treats them as multiple @doc tags in the module footer, causing ex_doc to fail. Replace with plain comments and export the reply/0 type to resolve ex_doc warnings about undefined private types. Co-Authored-By: Claude Opus 4.6 --- src/nova_plugin.erl | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/nova_plugin.erl b/src/nova_plugin.erl index 042ab4b..4a21609 100644 --- a/src/nova_plugin.erl +++ b/src/nova_plugin.erl @@ -28,32 +28,26 @@ -module(nova_plugin). -type request_type() :: pre_request | post_request. --export_type([request_type/0]). +-export_type([request_type/0, reply/0]). -type reply() :: {reply, Body :: binary()} | {reply, Status :: integer(), Body :: binary()} | {reply, Status :: integer(), Headers :: [{binary(), binary()}], Body :: binary()}. -%% @doc %% Start function for the plugin. This function is called when the plugin is started %% and will return a state that will be passed to the other functions during %% the life cycle of the plugin. The state can be any term. -%% @end -callback init() -> State :: nova:state(). -optional_callbacks([init/0]). -%% @doc %% Stop function for the plugin. This function is called when the application is stopped. %% It takes a state as argument and should return ok. -%% @end -callback stop(State :: nova:state()) -> ok. -optional_callbacks([stop/1]). -%% @doc %% This function is called before the request is processed. It can modify the request %% and the nova-state. It takes a state and a map of options as arguments and should return %% either {ok, NewState}, {break, NewState}, {stop, NewState} or {error, Reason}. -%% @end -callback pre_request(Req :: cowboy_req:req(), Env :: any(), Options :: map(), PluginState :: any()) -> {ok, Req0 :: cowboy_req:req(), NewState :: any()} | @@ -65,12 +59,10 @@ {error, Reason :: term()}. -optional_callbacks([pre_request/4]). -%% @doc %% This function is called after the request is processed. It can modify the request. %% It takes a state and a map of options as arguments and should return %% either {ok, NewState}, {break, NewState}, {stop, NewState} or {error, Reason}. %% The state is only used if there's another plugin invoked after this one. -%% @end -callback post_request(Req :: cowboy_req:req(), Env :: any(), Options :: map(), PluginState :: any()) -> {ok, Req0 :: cowboy_req:req(), NewState :: any()} | @@ -82,10 +74,8 @@ {error, Reason :: term()}. -optional_callbacks([post_request/4]). -%% @doc %% This function should return information about the plugin. The information is used %% in the documentation and in the plugin-listing. -%% @end -callback plugin_info() -> #{title := binary(), version := binary(), url := binary(),