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
For the default, you need to find all Erlang infix operators and figure out which ones make sense in this context and which ones doesn't. For instance, the result of X -- X is obvious ([]), but the result of X ++ X is not.
Reasoning
Paraphrasing Credo documentation:
In practice they are likely the result of a debugging session or were made by mistake.
Operation on Same Values
Brief Description
The idea is to emit a warning in situations where an infix operation is applied to the same value on both sides of it, like the ones below...
Should be on by default?
YES
Options
operations :: [atom()]
(default:['=', '==', '/=', '=:=', '=/=', 'and', 'andalso', 'or', 'orelse', …]
)For the default, you need to find all Erlang infix operators and figure out which ones make sense in this context and which ones doesn't. For instance, the result of
X -- X
is obvious ([]
), but the result ofX ++ X
is not.Reasoning
Paraphrasing Credo documentation:
Origin (#281)
Inspired by the
Warning.OperationOnSameValues
rule from Credo.Also inspired by the
Warning.BoolOperationOnSameValues
rule from Credo.The text was updated successfully, but these errors were encountered: