From 9f00f6beb4e50895156dae1b01653a46cb2156d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20F=C3=B6hring?= Date: Sat, 3 Aug 2024 21:13:05 +0200 Subject: [PATCH] Fix FunctionNames for private sigils Refs #1146 --- lib/credo/check/readability/function_names.ex | 4 ++-- test/credo/check/readability/function_names_test.exs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/credo/check/readability/function_names.ex b/lib/credo/check/readability/function_names.ex index 5c91c44a7..9ce09b9d1 100644 --- a/lib/credo/check/readability/function_names.ex +++ b/lib/credo/check/readability/function_names.ex @@ -66,7 +66,7 @@ defmodule Credo.Check.Readability.FunctionNames do _issue_meta, _allow_acronyms? ) - when op in [:def, :defmacro] do + when op in [:def, :defmacro, :defmacrop] do {ast, issues} end @@ -77,7 +77,7 @@ defmodule Credo.Check.Readability.FunctionNames do _issue_meta, _allow_acronyms? ) - when op in [:def, :defmacro] do + when op in [:def, :defmacro, :defmacrop] do {ast, issues} end end diff --git a/test/credo/check/readability/function_names_test.exs b/test/credo/check/readability/function_names_test.exs index 99144b224..6f5da87d3 100644 --- a/test/credo/check/readability/function_names_test.exs +++ b/test/credo/check/readability/function_names_test.exs @@ -69,6 +69,8 @@ defmodule Credo.Check.Readability.FunctionNamesTest do defmacro sigil_U({:<<>>, _, [string]}, []) when is_binary(string) do # ... end + defmacrop sigil_d(str, _opts) do + end """ |> to_source_file |> run_check(@described_check)