-
Notifications
You must be signed in to change notification settings - Fork 235
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
templates-no-negated-async not reporting some failures #615
Comments
I've started to looking at this issue and I found what's the problem:
For the first template above the results are:
It seems that there is a real problem with multiline templates. It's only getting the code from the first line, I really don't know why. Question:Why do we always assume that the expression is being compared to false? What if the user put
In this case, an user is trying to use
... instead, we replace the expression with Also, there are real failures related to the current replacement:
... After running
IMHO, we should remove the "fix" option for this rule, since we can't assume what the "expression" is trying to do... or maybe leave only the replace for strict equality ( |
Yes, we should remove the fix because it's not safe. |
@mgechev I'm still trying to find a valid use case for this rule, do you have one? Here...
... we say "Async pipes can not be negated". Why not? Take a look at this sample:
What would be the benefits of an explicit check like this |
@mgechev just to complement: unless there's a valid case that this rule could be useful, I'm voting in favor of deprecate this rule. |
I'll look at the story behind it over the weekend. |
@mgechev Friendly bump, have you looked? |
Yes, here's the motivation. I'm not sure if the value it brings justifies the corner cases you pointed. I'd vote to drop the rule. Let's keep the issue open for a few more days and collect opinions. |
@mgechev better close this and create a new issue about deprecate this rule or keep the discussion here? |
Sounds good! |
@rafaelss95 since we had this conversation, we reevaluated the pros and cons of this rule and introduced it in Google. Let's keep it as part of codelyzer. |
@mgechev Okay, can we just update the following failure message?
|
Sure. How do you suggest to update it? |
Reproduction:
The text was updated successfully, but these errors were encountered: