elvis_core icon indicating copy to clipboard operation
elvis_core copied to clipboard

no_successive_maps doesn't work when nested

Open rlipscombe opened this issue 3 months ago • 0 comments

Bug Description

The no_successive_maps rule (see #157 and #255) doesn't warn when using nested maps.

To Reproduce

This triggers the warning:

_ = [
    #{a => b, c => d},
    #{a => b, c => d} % elvis: Found map update after map construction/update
    #{a => b, c => d},
    #{a => b, c => d}
],

This doesn't:

_ = #{
    x => [
        #{a => b, c => d},
        #{a => b, c => d} % expected a warning here; didn't get one
        #{a => b, c => d},
        #{a => b, c => d}
    ]
},

Additional Context

  • OS: macOS
  • Erlang/OTP 26.2.1
  • erlang.mk; see below
BUILD_DEPS = elvis_mk
DEP_PLUGINS = elvis_mk
ELVIS_VERSION = 3.0.1
dep_elvis_mk = git https://github.com/inaka/elvis.mk.git

rlipscombe avatar Apr 03 '24 09:04 rlipscombe