Closed paulo-ferraz-oliveira closed 3 years ago
Related to inaka/elvis_core#136.
Edit: can be used to update the Rules wiki. Once the related PR is accepted.
Tentative documentation follows.
Per-module rules can also be configured using attribute -elvis(_)., with the same content as is expected in elvis.config's rules option, e.g.:
-elvis(_).
elvis.config
rules
-elvis([{elvis_style, no_behavior_info, #{}}]). -elvis([{elvis_style, no_nested_try_catch}]).
Note: a single attribute with a list of rules is the same as multiples attributes with a list of rules each - the rules are "merged" - as in:
-elvis([{elvis_style, no_behavior_info, #{}}, {elvis_style, no_nested_try_catch}]).
The ignore attribute, in this case, has limited value, since it'll be ignored for "other" modules. You can always play with the following, but results may not be surprising.
ignore
-module(mymodule). -elvis([{elvis_style, nesting_level, #{level => 4, ignore => [mymodule]}}]). ...
Haha! The ignore part... I would have forgotten about it entirely. Nice touch. Looks good.
I've added this to the Rules wiki since it's already available in master.
master
Related to inaka/elvis_core#136.
Edit: can be used to update the Rules wiki. Once the related PR is accepted.
Tentative documentation follows.
The -elvis attribute
Per-module rules can also be configured using attribute
-elvis(_).
, with the same content as is expected inelvis.config
'srules
option, e.g.:Note: a single attribute with a list of rules is the same as multiples attributes with a list of rules each - the rules are "merged" - as in:
The
ignore
attribute, in this case, has limited value, since it'll be ignored for "other" modules. You can always play with the following, but results may not be surprising.