I created a simple example to exemplify this problem
-module(test_maybe).
-feature(maybe_expr, enable).
-export([sum_numbers/2]).
sum_numbers(Number1, Number2) ->
maybe
ValidNumber1 ?= validate_number(Number1),
ValidNumber2 ?= validate_number(Number2),
Result = ValidNumber1 + ValidNumber2,
io:format("Results: ~p~n", [Result])
else
{error, invalid_number} ->
{error, "One or both inputs are invalid numbers"}
end.
validate_number(Number) when is_number(Number) ->
Number;
validate_number(_) ->
{error, invalid_number}.
i was trying to use rebar3 linter but the elvis got the following error
src/test_maybe.erl [FAIL]
* atom_naming_convention ([elvis_core/doc_rules/elvis_style/atom_naming_convention.md at main Ā· inaka/elvis_core Ā· GitHub](https://github.com/inaka/elvis_core/tree/main/doc_rules/elvis_style/atom_naming_convention.md))
* Atom on line -1 does not respect the format defined by the regular expression āā([a-zA-Z0-9@]*_?)*(_SUITE)?$āā.
===> Linting failed
Erlang Version: Erlang/OTP 26 [erts-14.2.4]
If somebody want to see this code with all dependencies
The important difference here is that the example regex matches the empty string. This also works for example, a modification of your regex to explicitly match the empty string:
There may be issues weāre not aware of, ofc but in this particular case itās the directive causing the issue. If you feel it important open an issue or pull request next to GitHub - inaka/elvis_core: The core of an Erlang linter.
The rebar.configās {minimum_otp_vsn, "25"}. is the special reason I gather. With that line removed and with OTP 27, it lints without error, but of course itās a syntax error on earlier versions of OTP.