Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
paulo-ferraz-oliveira opened this issue Sep 27, 2020 · 3 comments
Closed

Comments

@paulo-ferraz-oliveira
Copy link
Collaborator

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
Copy link
Contributor

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
Copy link
Member

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
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants