elvis_core icon indicating copy to clipboard operation
elvis_core copied to clipboard

Using ets:fun2ms without including ms_transform.hrl should be an error

Open rlipscombe opened this issue 1 year ago • 3 comments

Using ets:fun2ms without including ms_transform.hrl raises a runtime error, rather than a compile error:

The parse transform is provided in the ms_transform module and the source must include file ms_transform.hrl in STDLIB for this pseudo function to work. Failing to include the hrl file in the source results in a runtime error, not a compile time error. The include file is easiest included by adding line -include_lib("stdlib/include/ms_transform.hrl"). to the source file.

Describe the solution you'd like

If elvis could spot this, and raise an error, that'd save some headaches. I understand that it probably can't be exhaustive, but it'd be nice.

rlipscombe avatar Mar 27 '23 10:03 rlipscombe