inaka / elvis

Erlang Style Reviewer
Apache License 2.0
426 stars 87 forks source link

New Rule: Consistency in andalso/orelse v. ;/, in guards #538

Closed paulo-ferraz-oliveira closed 4 years ago

paulo-ferraz-oliveira commented 4 years ago

I tend to prefer explicit values andalso/orelse to their equivalent ;/,, but can understand other's reasons for not doing this and keep consistency when I edit "foreign" modules.

In any case, favoring consistency, I also think that you should choose one style over the other in a given project. Let's make this configurable. And choose a default.

Ideas for default values? Ideas for rule name?

jfacorro commented 4 years ago

One comment I have regarding this is that andalso/orelse can be combined in ways ,/; can't through the use of parenthesis. I'm not sure if enforcing the usage of a single style is limiting the expressions you can use and might need.

elbrujohalcon commented 4 years ago

Also... Since elvis analyzes files individually, the rule can't be "always use the same style". It must be "don't use $this and $that in guards".

I'm not too fond of this rule. But I am not 100% against it either.

paulo-ferraz-oliveira commented 4 years ago

Yeah, probably a dumb idea. Thanks for your thoughts.