From 8e5e80f1fa22041244a9f9928760de34f5ad4be1 Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Sat, 14 Jun 2025 21:13:51 +0100 Subject: [PATCH 1/2] Fix badge link and support range (#474) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 943eb44e..32baa40e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# `elvis_core` [![GitHub Actions CI](https://github.com/inaka/elvis_core/workflows/build/badge.svg)](https://github.com/inaka/elvis_core) [![Erlang Support](https://img.shields.io/badge/Erlang/OTP-25+-blue)](https://www.erlang.org) +# `elvis_core` [![GitHub Actions CI](https://github.com/inaka/elvis_core/workflows/build/badge.svg)](https://github.com/inaka/elvis_core/actions) [![Erlang Support](https://img.shields.io/badge/Erlang/OTP-26+-blue)](https://www.erlang.org) `elvis_core` is the core library for the [`elvis`](https://github.com/inaka/elvis) Erlang style reviewer. It is also used by [`rebar3_lint`](https://github.com/project-fifo/rebar3_lint) for easier From f6cdb5164ddb6b47d80047c3230c4cb9d98214aa Mon Sep 17 00:00:00 2001 From: Brujo Benavides Date: Mon, 16 Jun 2025 14:32:28 +0200 Subject: [PATCH 2/2] Alternative fix for #476 (#479) --- src/elvis_config.erl | 8 ++++---- test/elvis_SUITE.erl | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/elvis_config.erl b/src/elvis_config.erl index 84a50af4..00b1e5e8 100644 --- a/src/elvis_config.erl +++ b/src/elvis_config.erl @@ -127,19 +127,19 @@ is_invalid_rule({Module, RuleName, _}) -> is_invalid_rule({Module, RuleName}); is_invalid_rule({Module, RuleName}) -> maybe - {file, _} ?= code:is_loaded(Module), + {module, Module} ?= code:ensure_loaded(Module), ExportedRules = erlang:get_module_info(Module, exports), - case lists:keyfind(RuleName, 1, ExportedRules) of + case lists:keymember(RuleName, 1, ExportedRules) of false -> {true, {invalid_rule, {Module, RuleName}}}; _ -> false end else - false -> + {error, _} -> elvis_utils:warn_prn( "Invalid module (~p) specified in elvis.config.~n", [Module] ), - false + {true, {invalid_rule, {Module, RuleName}}} end. -spec normalize(configs()) -> configs(). diff --git a/test/elvis_SUITE.erl b/test/elvis_SUITE.erl index 40ff7b4a..d24ee6da 100644 --- a/test/elvis_SUITE.erl +++ b/test/elvis_SUITE.erl @@ -431,7 +431,9 @@ rock_with_invalid_rules(_Config) -> ExpectedErrorMessage = {invalid_rules, [ {invalid_rule, {elvis_style, not_existing_rule}}, - {invalid_rule, {elvis_style, what_is_this_rule}} + {invalid_rule, {elvis_style, what_is_this_rule}}, + {invalid_rule, {not_existing_module, dont_repeat_yourself}}, + {invalid_rule, {not_existing_module, dont_repeat_yourself}} ]}, try ok = elvis_core:rock(ElvisConfig),