Brujo Benavides
Brujo Benavides
## Avoid Comparison to Boolean ### Brief Description A rule that disallows comparison to booleans. ### Should be on by default? **YES** ### Reasoning This is because these expressions evaluate...
## Avoid Duplicate Keys in Maps ### Brief Description The idea is to emit a warning in situations like the following ones (notice the duplication of keys everywhere): ```erlang Map...
## Consistent Variable Naming ### Brief Description This is a more sophisticated version of #266, but it's also more _heuristic_ (thus the possibility of emitting false positives). The idea is...
## Strict Module Layout ### Brief Description Provide module parts in the required order. ```erlang -module(…). -include[_lib](…). -dialyzer(…). -elvis(…). -format #{…}. -hank(…). -mixin(…). … -type(…). -type(…). … -export_type(…). -export(…). exported_function_1(…)...
Ref: WhatsApp/erlfmt#91 * Omit `()` in macro names only if they represent constants ```erlang %% Bad -define(NOT_CONSTANT, application:get_env(myapp, key)). -define(CONSTANT(), 100). ``` ```erlang %% Good -define(NOT_CONSTANT(), application:get_env(myapp, key)). -define(CONSTANT, 100).
Inspired by https://hexdocs.pm/credo/Credo.Check.Refactor.ABCSize.html Read the comments below to find more possible rules :)
When possible, add code suggestions to the warnings. As an example, Instead of… > - macro_names > - Invalid macro name the_macro on line 11. Use UPPER_CASE. …say… > -...
Currently, our naming convention rules only allow for a single regex that identifies what is _permitted_/_valid_. It would be nice to add an additional _forbidden_ regex to identify things that...