From cbcdb74bbe4632f81211513a3f58fa8edb786a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20F=C3=B6hring?= Date: Wed, 14 Feb 2024 19:11:29 +0000 Subject: [PATCH] Mix format --- lib/credo/check/readability/with_custom_tagged_tuple.ex | 3 ++- lib/credo/check/refactor/append_single_item.ex | 3 ++- lib/credo/check/warning/map_get_unsafe_pass.ex | 3 ++- .../check/readability/with_custom_tagged_tuple_test.exs | 8 ++++++-- test/regression/run_older_credo_version.exs | 2 +- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/credo/check/readability/with_custom_tagged_tuple.ex b/lib/credo/check/readability/with_custom_tagged_tuple.ex index d28a40c1b..41a4960f0 100644 --- a/lib/credo/check/readability/with_custom_tagged_tuple.ex +++ b/lib/credo/check/readability/with_custom_tagged_tuple.ex @@ -75,7 +75,8 @@ defmodule Credo.Check.Readability.WithCustomTaggedTuple do defp issue_for(error, issue_meta) do format_issue( issue_meta, - message: "Avoid using tagged tuples as placeholders in `with` (found: `#{inspect(error.tuple_tag)}`).", + message: + "Avoid using tagged tuples as placeholders in `with` (found: `#{inspect(error.tuple_tag)}`).", line_no: error.line, trigger: inspect(error.tuple_tag) ) diff --git a/lib/credo/check/refactor/append_single_item.ex b/lib/credo/check/refactor/append_single_item.ex index cacb9de58..2308733c6 100644 --- a/lib/credo/check/refactor/append_single_item.ex +++ b/lib/credo/check/refactor/append_single_item.ex @@ -48,7 +48,8 @@ defmodule Credo.Check.Refactor.AppendSingleItem do defp issue_for(issue_meta, line_no, trigger) do format_issue( issue_meta, - message: "Appending a single item to a list is inefficient, use `[head | tail]` notation (and `Enum.reverse/1` when order matters).", + message: + "Appending a single item to a list is inefficient, use `[head | tail]` notation (and `Enum.reverse/1` when order matters).", trigger: trigger, line_no: line_no ) diff --git a/lib/credo/check/warning/map_get_unsafe_pass.ex b/lib/credo/check/warning/map_get_unsafe_pass.ex index eaa3db390..e8d2d62ad 100644 --- a/lib/credo/check/warning/map_get_unsafe_pass.ex +++ b/lib/credo/check/warning/map_get_unsafe_pass.ex @@ -83,7 +83,8 @@ defmodule Credo.Check.Warning.MapGetUnsafePass do defp issue_for(issue_meta, line_no, trigger) do format_issue( issue_meta, - message: "`Map.get` with no default return value is potentially unsafe in pipes, use `Map.get/3` instead.", + message: + "`Map.get` with no default return value is potentially unsafe in pipes, use `Map.get/3` instead.", trigger: trigger, line_no: line_no ) diff --git a/test/credo/check/readability/with_custom_tagged_tuple_test.exs b/test/credo/check/readability/with_custom_tagged_tuple_test.exs index 4dc6c9eba..803d2b6db 100644 --- a/test/credo/check/readability/with_custom_tagged_tuple_test.exs +++ b/test/credo/check/readability/with_custom_tagged_tuple_test.exs @@ -45,10 +45,14 @@ defmodule Credo.Check.Readability.WithCustomTaggedTupleTest do |> assert_issues(fn issues -> [issue1, issue2] = issues - assert issue1.message == "Avoid using tagged tuples as placeholders in `with` (found: `:resource`)." + assert issue1.message == + "Avoid using tagged tuples as placeholders in `with` (found: `:resource`)." + assert issue1.trigger == ":resource" - assert issue2.message == "Avoid using tagged tuples as placeholders in `with` (found: `:authz`)." + assert issue2.message == + "Avoid using tagged tuples as placeholders in `with` (found: `:authz`)." + assert issue2.trigger == ":authz" end) end diff --git a/test/regression/run_older_credo_version.exs b/test/regression/run_older_credo_version.exs index d325cb325..b8d272b76 100644 --- a/test/regression/run_older_credo_version.exs +++ b/test/regression/run_older_credo_version.exs @@ -1,4 +1,4 @@ -[credo_version|rest] = System.argv() +[credo_version | rest] = System.argv() Mix.install([ {:credo, credo_version}