-
Notifications
You must be signed in to change notification settings - Fork 0
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
False positives with Redundant
check
#5
Comments
This is not an issue about operator precedence, but rather an issue that the rule does not check what the contents on the left of the The rule considers what is on the right to see if it's safe to remove the I'm guessing the left side should wrapped in parentheses when it turns out the removal of testEmptyString text =
- 499| String.trim >> String.isEmpty <| text
+ 500| (String.trim >> String.isEmpty) text When using |
Ah, my mistake! I just assumed it was due to operator precedence. I guess considering the left-hand of the expression is necessary to avoid false positives, yes. |
Here's another example: String.fromInt << List.length <| someList The rule says
But that's not true: String.fromInt << List.length <| someList
===
(String.fromInt << List.length) <| someList and removing the String.fromInt << List.length someList
===
String.fromInt << (List.length someList) which doesn't compile. |
Great rule! Unfortunately the issue with operator precedence still exists, despite it being announced as fixed in #3.
It can be seen in this example code:
The "fix" is to remove the pipe (🍕 ) operator, but then the type of the function changes.
This happens using elm-review-noleftpizza 2.0.0 with node-elm-review 2.4.6 and elm-syntax 7.2.1.
The text was updated successfully, but these errors were encountered: