Macro Definition Parentheses

View Source
Parentheses should be used propely to increase readability. Macros that represent a function, should contains parentheses, macros that represent a constant, should not.
Avoid
-define(NOT_CONSTANT, application:get_env(myapp, key)).
-define(CONSTANT(), 100).Prefer
-define(NOT_CONSTANT(), application:get_env(myapp, key)).
-define(CONSTANT, 100).Rationale
Parentheses can help the reader to identify if there is a single value hiding behind the macro key or if it's meant to replace some sort of code execution.
Options
- None.
{elvis_style, macro_definition_parentheses, #{}}