-
-
Notifications
You must be signed in to change notification settings - Fork 12
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Rule for no "NoOp" expressions #52
Comments
It could also make sense to reduce the scope. My guess would be that only looking for Maybe it would make sense to have rule that only deals with
|
True, the I'm not certain about recommending if someFunction "a" 5 15 == False then vs if not (someFunction "a" 5 15) then or if someFunction "a" 5 15 |> not then Good point about swapping the order of the sub-expressions in the |
Could you recommend that Other useless maths that might also fit... Here's a bunch of unpublished rules that would cover cons and concat of lists, the later two have some pretty good fixes baked in too! With regards to the |
For more simplification ideas, check out the fsharplint hints: https://github.com/fsprojects/FSharpLint/blob/0007ec1e83a1043d74bcd5a0067c6483657faa26/src/FSharpLint.Core/DefaultConfiguration.json#L271-L397 |
I agree that you could highlight Failureif something == False then -- or: if not something then
bish
else if somethingElse then
bash
else
bosh Successif something then
if somethingElse then
bash
else
bosh
else
bish |
This leads to the possibility of simplifying more complicated boolean expressions, but perhaps that's a discussion for another issue? E.g., |
I think flipping |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
What the rule should do: Remove code that is effectively a noop.
Example of things the rule would report:
Example of things the rule would not report:
I am looking for:
Ideally someone who will do the work for me :)
But otherwise this is just so I don't forget about this so I can get around to doing it sometime.
I've also posted the issue here jfmengels/elm-review-simplify#1 as I think this would be a good place for this rule to exist.
The text was updated successfully, but these errors were encountered: