Closed sparksp closed 3 years ago
I would like to see this for left pizza. getName <| person
can be refactored to getName person
.
@lydell elm-review-noleftpizza
already offers that with NoLeftPizza.rule NoLeftPizza.Redundant
.
Thanks! Given the name – no left pizza – I didn’t expect finding that there. But I guess it makes sense now.
It wasn't there in the first iteration ;)
Back on the subject, I agree with this rule, this is a small pet peeve of mine and I often refactor things to remove this way manually. I think this could be auto-fixed, but I guess it can be a painful one to write. I know that some of my colleagues will be very annoyed at this kind of reports if they need to fix it manually.
What the rule should do:
Forbid simple uses of right pizza (
|>
) that would not add any parens if removed.What problems does it solve:
Pizza can make the place look untidy.
Example of things the rule would report:
Example of things the rule would not report:
When (not) to enable this rule:
If you really like pizza then this rule might not be for you. Right pizza are often used to show a pipeline, but right pizza may also be used to change the focus of an expression - this rule may complain about such expressions.
I am looking for: