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
In some places in our code, we have "enum-like" string or int types (for example, see LocalOperation), which "expects" values from a pre-defined list (in the LocalOperation example, we have commitOperation, pullOperation, etc.).
Casting strings or integers into such types creates buggy flow, so we should avoid such explicit casts. Any cast must either go through an appropriately named func with error checking, or be accompanied by a comment re-explaining why it is valid.
This Issue is about detecting all such occurrences in our code, and fixing them to follow the "named-func-or-comment" rule above.
The text was updated successfully, but these errors were encountered:
In some places in our code, we have "enum-like" string or int types (for example, see
LocalOperation
), which "expects" values from a pre-defined list (in theLocalOperation
example, we havecommitOperation
,pullOperation
, etc.).Casting strings or integers into such types creates buggy flow, so we should avoid such explicit casts.
Any cast must either go through an appropriately named func with error checking, or be accompanied by a comment re-explaining why it is valid.
This Issue is about detecting all such occurrences in our code, and fixing them to follow the "named-func-or-comment" rule above.
The text was updated successfully, but these errors were encountered: