diff --git a/.credo.exs b/.credo.exs new file mode 100644 index 0000000..c3d94b6 --- /dev/null +++ b/.credo.exs @@ -0,0 +1,216 @@ +# This file contains the configuration for Credo and you are probably reading +# this after creating it with `mix credo.gen.config`. +# +# If you find anything wrong or unclear in this file, please report an +# issue on GitHub: https://github.com/rrrene/credo/issues +# +%{ + # + # You can have as many configs as you like in the `configs:` field. + configs: [ + %{ + # + # Run any config using `mix credo -C `. If no config name is given + # "default" is used. + # + name: "default", + # + # These are the files included in the analysis: + files: %{ + # + # You can give explicit globs or simply directories. + # In the latter case `**/*.{ex,exs}` will be used. + # + included: [ + "lib/", + "src/", + "test/", + "web/", + "apps/*/lib/", + "apps/*/src/", + "apps/*/test/", + "apps/*/web/" + ], + excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] + }, + # + # Load and configure plugins here: + # + plugins: [], + # + # If you create your own checks, you must specify the source files for + # them here, so they can be loaded by Credo before running the analysis. + # + requires: [], + # + # If you want to enforce a style guide and need a more traditional linting + # experience, you can change `strict` to `true` below: + # + strict: false, + # + # To modify the timeout for parsing files, change this value: + # + parse_timeout: 5000, + # + # If you want to use uncolored output by default, you can change `color` + # to `false` below: + # + color: false, + # + # You can customize the parameters of any check by adding a second element + # to the tuple. + # + # To disable a check put `false` as second element: + # + # {Credo.Check.Design.DuplicatedCode, false} + # + checks: %{ + enabled: [ + # + ## Consistency Checks + # + {Credo.Check.Consistency.ExceptionNames, []}, + {Credo.Check.Consistency.LineEndings, []}, + {Credo.Check.Consistency.ParameterPatternMatching, []}, + {Credo.Check.Consistency.SpaceAroundOperators, []}, + {Credo.Check.Consistency.SpaceInParentheses, []}, + {Credo.Check.Consistency.TabsOrSpaces, []}, + + # + ## Design Checks + # + # You can customize the priority of any check + # Priority values are: `low, normal, high, higher` + # + {Credo.Check.Design.AliasUsage, + [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]}, + # You can also customize the exit_status of each check. + # If you don't want TODO comments to cause `mix credo` to fail, just + # set this value to 0 (zero). + # + {Credo.Check.Design.TagTODO, [exit_status: 2]}, + {Credo.Check.Design.TagFIXME, []}, + + # + ## Readability Checks + # + {Credo.Check.Readability.AliasOrder, []}, + {Credo.Check.Readability.FunctionNames, []}, + {Credo.Check.Readability.LargeNumbers, []}, + {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, + {Credo.Check.Readability.ModuleAttributeNames, []}, + {Credo.Check.Readability.ModuleDoc, []}, + {Credo.Check.Readability.ModuleNames, []}, + {Credo.Check.Readability.ParenthesesInCondition, []}, + {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, + {Credo.Check.Readability.PipeIntoAnonymousFunctions, []}, + {Credo.Check.Readability.PredicateFunctionNames, []}, + {Credo.Check.Readability.PreferImplicitTry, []}, + {Credo.Check.Readability.RedundantBlankLines, []}, + {Credo.Check.Readability.Semicolons, []}, + {Credo.Check.Readability.SpaceAfterCommas, []}, + {Credo.Check.Readability.StringSigils, []}, + {Credo.Check.Readability.TrailingBlankLine, []}, + {Credo.Check.Readability.TrailingWhiteSpace, []}, + {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, + {Credo.Check.Readability.VariableNames, []}, + {Credo.Check.Readability.WithSingleClause, []}, + + # + ## Refactoring Opportunities + # + {Credo.Check.Refactor.Apply, []}, + {Credo.Check.Refactor.CondStatements, []}, + {Credo.Check.Refactor.CyclomaticComplexity, []}, + {Credo.Check.Refactor.FunctionArity, []}, + {Credo.Check.Refactor.LongQuoteBlocks, []}, + {Credo.Check.Refactor.MatchInCondition, []}, + {Credo.Check.Refactor.MapJoin, []}, + {Credo.Check.Refactor.NegatedConditionsInUnless, []}, + {Credo.Check.Refactor.NegatedConditionsWithElse, []}, + {Credo.Check.Refactor.Nesting, []}, + {Credo.Check.Refactor.UnlessWithElse, []}, + {Credo.Check.Refactor.WithClauses, []}, + {Credo.Check.Refactor.FilterCount, []}, + {Credo.Check.Refactor.FilterFilter, []}, + {Credo.Check.Refactor.RejectReject, []}, + {Credo.Check.Refactor.RedundantWithClauseResult, []}, + + # + ## Warnings + # + {Credo.Check.Warning.ApplicationConfigInModuleAttribute, []}, + {Credo.Check.Warning.BoolOperationOnSameValues, []}, + {Credo.Check.Warning.Dbg, []}, + {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, + {Credo.Check.Warning.IExPry, []}, + {Credo.Check.Warning.IoInspect, []}, + {Credo.Check.Warning.MissedMetadataKeyInLoggerConfig, []}, + {Credo.Check.Warning.OperationOnSameValues, []}, + {Credo.Check.Warning.OperationWithConstantResult, []}, + {Credo.Check.Warning.RaiseInsideRescue, []}, + {Credo.Check.Warning.SpecWithStruct, []}, + {Credo.Check.Warning.WrongTestFileExtension, []}, + {Credo.Check.Warning.UnusedEnumOperation, []}, + {Credo.Check.Warning.UnusedFileOperation, []}, + {Credo.Check.Warning.UnusedKeywordOperation, []}, + {Credo.Check.Warning.UnusedListOperation, []}, + {Credo.Check.Warning.UnusedPathOperation, []}, + {Credo.Check.Warning.UnusedRegexOperation, []}, + {Credo.Check.Warning.UnusedStringOperation, []}, + {Credo.Check.Warning.UnusedTupleOperation, []}, + {Credo.Check.Warning.UnsafeExec, []} + ], + disabled: [ + # + # Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`) + + # + # Controversial and experimental checks (opt-in, just move the check to `:enabled` + # and be sure to use `mix credo --strict` to see low priority checks) + # + {Credo.Check.Consistency.MultiAliasImportRequireUse, []}, + {Credo.Check.Consistency.UnusedVariableNames, []}, + {Credo.Check.Design.DuplicatedCode, []}, + {Credo.Check.Design.SkipTestWithoutComment, []}, + {Credo.Check.Readability.AliasAs, []}, + {Credo.Check.Readability.BlockPipe, []}, + {Credo.Check.Readability.ImplTrue, []}, + {Credo.Check.Readability.MultiAlias, []}, + {Credo.Check.Readability.NestedFunctionCalls, []}, + {Credo.Check.Readability.OneArityFunctionInPipe, []}, + {Credo.Check.Readability.SeparateAliasRequire, []}, + {Credo.Check.Readability.SingleFunctionToBlockPipe, []}, + {Credo.Check.Readability.SinglePipe, []}, + {Credo.Check.Readability.Specs, []}, + {Credo.Check.Readability.StrictModuleLayout, []}, + {Credo.Check.Readability.WithCustomTaggedTuple, []}, + {Credo.Check.Readability.OnePipePerLine, []}, + {Credo.Check.Refactor.ABCSize, []}, + {Credo.Check.Refactor.AppendSingleItem, []}, + {Credo.Check.Refactor.DoubleBooleanNegation, []}, + {Credo.Check.Refactor.FilterReject, []}, + {Credo.Check.Refactor.IoPuts, []}, + {Credo.Check.Refactor.MapMap, []}, + {Credo.Check.Refactor.ModuleDependencies, []}, + {Credo.Check.Refactor.NegatedIsNil, []}, + {Credo.Check.Refactor.PassAsyncInTestCases, []}, + {Credo.Check.Refactor.PipeChainStart, []}, + {Credo.Check.Refactor.RejectFilter, []}, + {Credo.Check.Refactor.VariableRebinding, []}, + {Credo.Check.Warning.LazyLogging, []}, + {Credo.Check.Warning.LeakyEnvironment, []}, + {Credo.Check.Warning.MapGetUnsafePass, []}, + {Credo.Check.Warning.MixEnv, []}, + {Credo.Check.Warning.UnsafeToAtom, []} + + # {Credo.Check.Refactor.MapInto, []}, + + # + # Custom checks can be created using `mix credo.gen.check`. + # + ] + } + } + ] +} diff --git a/lib/chiya/tags/tag_updater.ex b/lib/chiya/tags/tag_updater.ex index 4272502..17f4ef2 100644 --- a/lib/chiya/tags/tag_updater.ex +++ b/lib/chiya/tags/tag_updater.ex @@ -104,7 +104,8 @@ defmodule Chiya.Tags.TagUpdater do true {:error, changeset} -> - Logger.warn(inspect(changeset)) + Logger.warning(inspect(changeset)) + false end end end diff --git a/lib/chiya_web/controllers/note_controller.ex b/lib/chiya_web/controllers/note_controller.ex index 3bf356b..8e26528 100644 --- a/lib/chiya_web/controllers/note_controller.ex +++ b/lib/chiya_web/controllers/note_controller.ex @@ -31,8 +31,6 @@ defmodule ChiyaWeb.NoteController do |> put_flash(:info, "Note created successfully.") |> redirect(to: ~p"/admin/notes/#{note}") - # TODO: set channels from changeset when error happened? - {:error, %Ecto.Changeset{} = changeset} -> render(conn, :new, changeset: changeset, @@ -69,8 +67,6 @@ defmodule ChiyaWeb.NoteController do |> put_flash(:info, "Note updated successfully.") |> redirect(to: ~p"/admin/notes/#{note}") - # TODO: set channels from changeset when error happened? - {:error, %Ecto.Changeset{} = changeset} -> render(conn, :edit, note: note, @@ -195,17 +191,7 @@ defmodule ChiyaWeb.NoteController do ) end - defp with_channels(conn) do - assign( - conn, - :channels, - Chiya.Channels.list_channels() - |> Chiya.Channels.preload_channel() - |> Enum.filter(fn c -> not Enum.empty?(c.notes) end) - ) - end - - defp get_default_channels(conn = %Plug.Conn{}) do + defp get_default_channels(%Plug.Conn{} = conn) do if conn.assigns.settings.default_channel do [conn.assigns.settings.default_channel.id] else diff --git a/lib/chiya_web/controllers/page_controller.ex b/lib/chiya_web/controllers/page_controller.ex index 9109e23..a49432d 100644 --- a/lib/chiya_web/controllers/page_controller.ex +++ b/lib/chiya_web/controllers/page_controller.ex @@ -5,17 +5,9 @@ defmodule ChiyaWeb.PageController do plug :put_layout, html: {ChiyaWeb.Layouts, :public} plug :put_assigns - defp put_assigns(conn, opts) do - conn - |> assign(:page_header, true) - |> assign(:page_title, "no title") - end - def home(conn, params) do - settings = conn.assigns.settings - - if settings.home_channel_id do - channel = Channels.get_channel!(settings.home_channel_id) + if id = conn.assigns.settings.home_channel_id do + channel = Channels.get_channel!(id) {:ok, {notes, meta}} = Chiya.Notes.list_home_notes(channel, params) render(conn, :home, @@ -26,13 +18,14 @@ defmodule ChiyaWeb.PageController do page_header: false ) else - render_error(conn, :not_found) + not_found(conn) end end def channel(conn, %{"slug" => channel_slug}) do channel = - Channels.get_channel_by_slug!(channel_slug) + channel_slug + |> Channels.get_channel_by_slug!() |> Channels.preload_channel_public() render(conn, :channel, @@ -63,7 +56,7 @@ defmodule ChiyaWeb.PageController do page_header: false ) else - render_error(conn, :not_found) + not_found(conn) end end @@ -78,7 +71,7 @@ defmodule ChiyaWeb.PageController do page_title: user.name ) else - render_error(conn, :not_found) + not_found(conn) end end @@ -94,7 +87,7 @@ defmodule ChiyaWeb.PageController do content: channel.content ) else - render_error(conn, :not_found) + not_found(conn) end end @@ -109,7 +102,18 @@ defmodule ChiyaWeb.PageController do page_title: "#{Enum.count(notes)} Bookmarks" ) else - render_error(conn, :not_found) + not_found(conn) end end + + defp not_found(conn) do + conn + |> assign(:page_title, "404 Not found") + |> render_error(:not_found) + end + + defp put_assigns(conn, opts) do + conn + |> assign(:page_header, true) + end end diff --git a/lib/chiya_web/controllers/tag_controller.ex b/lib/chiya_web/controllers/tag_controller.ex index 781a98f..52aa51e 100644 --- a/lib/chiya_web/controllers/tag_controller.ex +++ b/lib/chiya_web/controllers/tag_controller.ex @@ -25,7 +25,6 @@ defmodule ChiyaWeb.TagController do notes = Chiya.Notes.list_apply_notes(tag) Enum.each(notes, fn note -> - IO.inspect("Updating note: #{note.name}") Chiya.Tags.TagUpdater.add_tags(note, [tag.slug]) end) @@ -34,7 +33,6 @@ defmodule ChiyaWeb.TagController do end def edit(conn, %{"id" => id}) do - IO.inspect(id) tag = Tags.get_tag!(id) changeset = Tags.change_tag(tag) @@ -54,8 +52,6 @@ defmodule ChiyaWeb.TagController do |> put_flash(:info, "Tags updated successfully.") |> redirect(to: ~p"/admin/tags") - # TODO: set channels from changeset when error happened? - {:error, %Ecto.Changeset{} = changeset} -> render(conn, :edit, tag: tag, diff --git a/lib/chiya_web/indie/micropub.ex b/lib/chiya_web/indie/micropub.ex index df243e7..76c4b57 100644 --- a/lib/chiya_web/indie/micropub.ex +++ b/lib/chiya_web/indie/micropub.ex @@ -139,11 +139,11 @@ defmodule ChiyaWeb.Indie.Micropub do tags = Props.get_tags(source) attrs = - if !Enum.empty?(tags) do + if Enum.empty?(tags) do + attrs + else tags_string = Enum.join(tags, ",") Map.put(attrs, :tags_string, tags_string) - else - attrs end attrs @@ -156,7 +156,9 @@ defmodule ChiyaWeb.Indie.Micropub do defp verify_app_token(access_token) do token = Chiya.Accounts.get_app_token("obsidian", "app") - if not is_nil(token) do + if is_nil(token) do + {:error, :insufficient_scope, "Could not verify app token"} + else token_string = token.token |> :crypto.bytes_to_integer() @@ -167,8 +169,6 @@ defmodule ChiyaWeb.Indie.Micropub do else {:error, :insufficient_scope, "Could not verify app token"} end - else - {:error, :insufficient_scope, "Could not verify app token"} end end diff --git a/lib/chiya_web/live/admin_home_live.ex b/lib/chiya_web/live/admin_home_live.ex index a8dbc37..e65183d 100644 --- a/lib/chiya_web/live/admin_home_live.ex +++ b/lib/chiya_web/live/admin_home_live.ex @@ -37,8 +37,6 @@ defmodule ChiyaWeb.AdminHomeLive do |> push_navigate(to: ~p"/note/#{note.slug}")} {:error, %Ecto.Changeset{} = changeset} -> - IO.inspect(changeset) - {:noreply, socket |> put_flash(:error, "Could not create note!") diff --git a/lib/chiya_web/live/note_list_live.ex b/lib/chiya_web/live/note_list_live.ex index dbce6d1..570250f 100644 --- a/lib/chiya_web/live/note_list_live.ex +++ b/lib/chiya_web/live/note_list_live.ex @@ -22,7 +22,6 @@ defmodule ChiyaWeb.NoteListLive do {:noreply, socket |> assign(%{notes: notes, meta: meta})} {:error, data} -> - IO.inspect(data) {:noreply, socket} end end diff --git a/lib/chiya_web/plugs/plug_micropub.ex b/lib/chiya_web/plugs/plug_micropub.ex index eadbfd7..4219243 100644 --- a/lib/chiya_web/plugs/plug_micropub.ex +++ b/lib/chiya_web/plugs/plug_micropub.ex @@ -161,7 +161,6 @@ defmodule ChiyaWeb.Plugs.PlugMicropub do defp parse_auth_header(conn) do with [header] <- get_req_header(conn, "authorization"), - _ = IO.inspect(header), "Bearer" <> token <- header, do: {:ok, String.trim(token), conn}, else: (_ -> {:error, :unauthorized}) @@ -206,17 +205,25 @@ defmodule ChiyaWeb.Plugs.PlugMicropub do defp handle_action(:delete, access_token, conn) do Logger.info("Micropub: Handle delete") - with {:ok, url} <- Map.fetch(conn.body_params, "url"), - do: do_delete(conn, access_token, url), - else: (_ -> send_error(conn, {:error, :invalid_request})) + case Map.fetch(conn.body_params, "url") do + {:ok, url} -> + do_delete(conn, access_token, url) + + _ -> + send_error(conn, {:error, :invalid_request}) + end end defp handle_action(:undelete, access_token, conn) do Logger.info("Micropub: Handle undelete") - with {:ok, url} <- Map.fetch(conn.body_params, "url"), - do: do_undelete(conn, access_token, url), - else: (_ -> send_error(conn, {:error, :invalid_request})) + case Map.fetch(conn.body_params, "url") do + {:ok, url} -> + do_undelete(conn, access_token, url) + + _ -> + send_error(conn, {:error, :invalid_request}) + end end defp handle_query(:config, access_token, conn) do @@ -252,9 +259,10 @@ defmodule ChiyaWeb.Plugs.PlugMicropub do defp handle_query(:source, access_token, conn) do Logger.info("Micropub: Handle source query") - with {:ok, url} <- Map.fetch(conn.query_params, "url") do - do_source_query(conn, access_token, url) - else + case Map.fetch(conn.query_params, "url") do + {:ok, url} -> + do_source_query(conn, access_token, url) + error -> Logger.warning("Micropub: Error while handling source: #{inspect(error)}") send_error(conn, {:error, :invalid_request}) diff --git a/lib/chiya_web/references.ex b/lib/chiya_web/references.ex index 17422ad..7163d28 100644 --- a/lib/chiya_web/references.ex +++ b/lib/chiya_web/references.ex @@ -76,7 +76,7 @@ defmodule ChiyaWeb.References do end defp get_link_class(valid) do - if not valid, do: "{:.invalid}", else: "" + if valid, do: "", else: "{:.invalid}" end defp map_to_tuple([placeholder, note_slug]), diff --git a/mix.exs b/mix.exs index 5433f52..01ca8dc 100644 --- a/mix.exs +++ b/mix.exs @@ -35,6 +35,7 @@ defmodule Chiya.MixProject do {:bcrypt_elixir, "~> 3.0"}, {:cors_plug, "~> 3.0"}, {:coverex, "~> 1.5", only: :test}, + {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:earmark, "~> 1.4"}, {:ecto_autoslug_field, "~> 3.0"}, {:ecto_sql, "~> 3.6"}, diff --git a/mix.lock b/mix.lock index 122a4f3..152c7a4 100644 --- a/mix.lock +++ b/mix.lock @@ -1,5 +1,6 @@ %{ "bcrypt_elixir": {:hex, :bcrypt_elixir, "3.1.0", "0b110a9a6c619b19a7f73fa3004aa11d6e719a67e672d1633dc36b6b2290a0f7", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "2ad2acb5a8bc049e8d5aa267802631912bb80d5f4110a178ae7999e69dca1bf7"}, + "bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"}, "castore": {:hex, :castore, "1.0.3", "7130ba6d24c8424014194676d608cb989f62ef8039efd50ff4b3f33286d06db8", [:mix], [], "hexpm", "680ab01ef5d15b161ed6a95449fac5c6b8f60055677a8e79acf01b27baa4390b"}, "certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"}, "comeonin": {:hex, :comeonin, "5.4.0", "246a56ca3f41d404380fc6465650ddaa532c7f98be4bda1b4656b3a37cc13abe", [:mix], [], "hexpm", "796393a9e50d01999d56b7b8420ab0481a7538d0caf80919da493b4a6e51faf1"}, @@ -8,10 +9,11 @@ "cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"}, "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, "cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"}, + "credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"}, "db_connection": {:hex, :db_connection, "2.5.0", "bb6d4f30d35ded97b29fe80d8bd6f928a1912ca1ff110831edcd238a1973652c", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c92d5ba26cd69ead1ff7582dbb860adeedfff39774105a4f1c92cbb654b55aa2"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, - "earmark": {:hex, :earmark, "1.4.39", "acdb2f02c536471029dbcc509fbd6b94b89f40ad7729fb3f68f4b6944843f01d", [:mix], [{:earmark_parser, "~> 1.4.33", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "156c9d8ec3cbeccdbf26216d8247bdeeacc8c76b4d9eee7554be2f1b623ea440"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.33", "3c3fd9673bb5dcc9edc28dd90f50c87ce506d1f71b70e3de69aa8154bc695d44", [:mix], [], "hexpm", "2d526833729b59b9fdb85785078697c72ac5e5066350663e5be6a1182da61b8f"}, + "earmark": {:hex, :earmark, "1.4.40", "ff1a0f8bf3b298113c2a257c4e7a8b29ba9db5d35f5ee6d29291cb8caa09a071", [:mix], [{:earmark_parser, "~> 1.4.35", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "5fb622d5e36046bc313a426211e8bf769ba50db7720744859a21932c6470d75c"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.35", "437773ca9384edf69830e26e9e7b2e0d22d2596c4a6b17094a3b29f01ea65bb8", [:mix], [], "hexpm", "8652ba3cb85608d0d7aa2d21b45c6fad4ddc9a1f9a1f1b30ca3a246f0acc33f6"}, "ecto": {:hex, :ecto, "3.10.3", "eb2ae2eecd210b4eb8bece1217b297ad4ff824b4384c0e3fdd28aaf96edd6135", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "44bec74e2364d491d70f7e42cd0d690922659d329f6465e89feb8a34e8cd3433"}, "ecto_autoslug_field": {:hex, :ecto_autoslug_field, "3.1.0", "ddf26e814baf3c32c6aebfed56a637f10a097db83f65d71e6f2d1e7faf2e9e51", [:mix], [{:ecto, ">= 3.7.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:slugify, "~> 1.3", [hex: :slugify, repo: "hexpm", optional: false]}], "hexpm", "b6ddd614805263e24b5c169532c934440d0289181cce873061fca3a8e92fd9ff"}, "ecto_sql": {:hex, :ecto_sql, "3.10.2", "6b98b46534b5c2f8b8b5f03f126e75e2a73c64f3c071149d32987a5378b0fdbd", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.10.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "68c018debca57cb9235e3889affdaec7a10616a4e3a80c99fa1d01fdafaa9007"}, @@ -56,7 +58,7 @@ "slugger": {:hex, :slugger, "0.3.0", "efc667ab99eee19a48913ccf3d038b1fb9f165fa4fbf093be898b8099e61b6ed", [:mix], [], "hexpm", "20d0ded0e712605d1eae6c5b4889581c3460d92623a930ddda91e0e609b5afba"}, "slugify": {:hex, :slugify, "1.3.1", "0d3b8b7e5c1eeaa960e44dce94382bee34a39b3ea239293e457a9c5b47cc6fd3", [:mix], [], "hexpm", "cb090bbeb056b312da3125e681d98933a360a70d327820e4b7f91645c4d8be76"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, - "swoosh": {:hex, :swoosh, "1.11.5", "429dccde78e2f60c6339e96917efecebca9d1f254d2878a150f580d2f782260b", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "21ee57dcd68d2f56d3bbe11e76d56d142b221bb12b6018c551cc68442b800040"}, + "swoosh": {:hex, :swoosh, "1.11.6", "7093531c12a537839c7b0777276aaad9f38a887e61c1d517f3b6a8dc6e9040d9", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7fbb7bd0b674e344dbd3a15c33ca787357663ef534dde2cc5ee74d00f7427fd5"}, "tailwind": {:hex, :tailwind, "0.2.1", "83d8eadbe71a8e8f67861fe7f8d51658ecfb258387123afe4d9dc194eddc36b0", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}], "hexpm", "e8a13f6107c95f73e58ed1b4221744e1eb5a093cd1da244432067e19c8c9a277"}, "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"}, diff --git a/test/chiya_web/indie/micropub_test.exs b/test/chiya_web/indie/micropub_test.exs index a6825c9..417f401 100644 --- a/test/chiya_web/indie/micropub_test.exs +++ b/test/chiya_web/indie/micropub_test.exs @@ -48,8 +48,6 @@ defmodule ChiyaWeb.MicropubTest do assert {:ok, %Note{} = note} = Micropub.update_note(note, %{"category" => ["foo", "bar"]}, %{}, %{}) - IO.inspect(note) - assert Enum.empty?(note.tags) == false end end