You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extend boolean_arithmetic_linter() to include all()-alike expressions like sum(x == y) == length(x) --> all(x == y).
The issues are
we can't just test for length() on the RHS (e.g. sum(x == y) == length(z) could be totally different)
looking for sum(x == y) == length(x == y) (i.e., exact expression matching, which we do in some other places) will only find a particularly silly manifestation of the issue
there is a bit of a combinatorial explosion if we have to look for any symbol found inside the logical expression on the RHS (e.g. sum(x == y) == [length(x) _or_ length(y)]).
A first pass would be to check how many hits there are for the naive version (i.e., condition 1), to see how worth investing in this complicated logic is to begin with.
The text was updated successfully, but these errors were encountered:
Follow-up to #1579
Extend
boolean_arithmetic_linter()
to includeall()
-alike expressions likesum(x == y) == length(x)
-->all(x == y)
.The issues are
length()
on the RHS (e.g.sum(x == y) == length(z)
could be totally different)sum(x == y) == length(x == y)
(i.e., exact expression matching, which we do in some other places) will only find a particularly silly manifestation of the issuesum(x == y) == [length(x) _or_ length(y)]
).A first pass would be to check how many hits there are for the naive version (i.e., condition 1), to see how worth investing in this complicated logic is to begin with.
The text was updated successfully, but these errors were encountered: