diff --git a/src/elvis_style.erl b/src/elvis_style.erl index 8cfde9cb..52fe1e7a 100644 --- a/src/elvis_style.erl +++ b/src/elvis_style.erl @@ -195,7 +195,7 @@ default(no_common_caveats_call) -> {timer, send_interval, 3}, {erlang, size, 1}]}; default(atom_naming_convention) -> - #{regex => "^[a-z]+((_?[a-z0-9])*[a-z0-9]+)*(_SUITE)?$", enclosed_atoms => ".*"}; + #{regex => "^[a-z](_?[a-z0-9]+)*(_SUITE)?$", enclosed_atoms => ".*"}; %% Not restrictive. Those who want more restrictions can set it like "^[^_]*$" default(numeric_format) -> #{regex => ".*", diff --git a/test/examples/fail_atom_naming_convention.erl b/test/examples/fail_atom_naming_convention.erl index 70945fc7..2d75f84f 100644 --- a/test/examples/fail_atom_naming_convention.erl +++ b/test/examples/fail_atom_naming_convention.erl @@ -19,4 +19,5 @@ for_test() -> '_something', % invalid because it starts with underscore '42_invalid_because_it_starts_with_a_number', '42invalid', %% even without underscores - weDontSupportCamelCaseHere. + weDontSupportCamelCaseHere, + not_even_in_a__SUITE. diff --git a/test/examples/pass_atom_naming_convention.erl b/test/examples/pass_atom_naming_convention.erl index 8174f746..9536ef86 100644 --- a/test/examples/pass_atom_naming_convention.erl +++ b/test/examples/pass_atom_naming_convention.erl @@ -9,4 +9,6 @@ for_test() -> non_200, '_', % used by ets/mnesia/etc. non200, % valid, even without underscores - valid_200even_if_numb3rs_appear_between_letters. + valid_200even_if_numb3rs_appear_between_letters, + blahblah_SUITE, + x. diff --git a/test/style_SUITE.erl b/test/style_SUITE.erl index af9361f2..10b1a1e6 100644 --- a/test/style_SUITE.erl +++ b/test/style_SUITE.erl @@ -1302,7 +1302,7 @@ verify_atom_naming_convention(Config) -> Group = proplists:get_value(group, Config, erl_files), Ext = proplists:get_value(test_file_ext, Config, "erl"), - BaseRegex = "^[a-z]+((_?[a-z0-9])*[a-z0-9]+)*$", + BaseRegex = "^[a-z](_?[a-z0-9]+)*(_SUITE)?$", % pass PassModule = pass_atom_naming_convention, @@ -1337,7 +1337,7 @@ verify_atom_naming_convention(Config) -> FailModule2 = fail_atom_naming_convention_exception_class, FailPath2 = atom_to_list(FailModule2) ++ "." ++ Ext, - [_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] = + [_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] = elvis_core_apply_rule(Config, elvis_style, atom_naming_convention,