-
Notifications
You must be signed in to change notification settings - Fork 26
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 idea: conditional-expressions-should-be-in-brackets #1152
Comments
Compliant and incompliant are functionally different. |
Output is identical |
Your remark kind of proves my point ;-) . It's confusing. It's not my code, I don't know which version is functionally correct, looking at the indentation I think the developer assumes this to behave like the compliant version, even if it behaves as Functionally equivalent compliant code
|
Assuming that the actual case was attempting to use x[1] and x[2], watch how different the results are (extended to 3 to make it even more obviously different):
The output is different. |
I was initially focused on the parser execution time, and I assumed the code of the developer was right. Given how that was formatted, I assumed the code was right and tested. It clearly wasn't... |
I'd like to propose a new rule :
conditional-expressions-should-be-in-brackets
.Non-compliant code
Compliant code
The text was updated successfully, but these errors were encountered: